2016-04-03 00:14:49 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2016, Rene Gollent, rene@gollent.com.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef TARGET_HOST_INTERFACE_H
|
|
|
|
#define TARGET_HOST_INTERFACE_H
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
2016-04-07 03:55:50 +03:00
|
|
|
#include <ObjectList.h>
|
2016-04-03 00:14:49 +03:00
|
|
|
#include <Referenceable.h>
|
|
|
|
|
|
|
|
|
|
|
|
class DebuggerInterface;
|
|
|
|
class TargetHost;
|
2016-04-07 03:55:50 +03:00
|
|
|
class TeamDebugger;
|
2016-04-03 00:14:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
class TargetHostInterface : public BReferenceable {
|
|
|
|
public:
|
2016-04-07 03:55:50 +03:00
|
|
|
TargetHostInterface();
|
2016-04-03 00:14:49 +03:00
|
|
|
virtual ~TargetHostInterface();
|
|
|
|
|
|
|
|
const BString& Name() const { return fName; }
|
|
|
|
void SetName(const BString& name);
|
|
|
|
|
2016-04-07 03:55:50 +03:00
|
|
|
|
|
|
|
int32 CountTeamDebuggers() const;
|
|
|
|
TeamDebugger* TeamDebuggerAt(int32 index) const;
|
|
|
|
TeamDebugger* FindTeamDebugger(team_id team) const;
|
|
|
|
status_t AddTeamDebugger(TeamDebugger* debugger);
|
|
|
|
void RemoveTeamDebugger(TeamDebugger* debugger);
|
|
|
|
|
|
|
|
virtual status_t Init() = 0;
|
|
|
|
virtual void Close() = 0;
|
|
|
|
|
2016-04-03 00:14:49 +03:00
|
|
|
virtual bool Connected() const = 0;
|
|
|
|
|
|
|
|
virtual TargetHost* GetTargetHost() = 0;
|
|
|
|
|
|
|
|
virtual status_t Attach(team_id id, thread_id threadID,
|
|
|
|
DebuggerInterface*& _interface) = 0;
|
|
|
|
|
|
|
|
virtual status_t CreateTeam(int commandLineArgc,
|
|
|
|
const char* const* arguments,
|
|
|
|
DebuggerInterface*& _interface) = 0;
|
|
|
|
|
2016-04-07 03:55:50 +03:00
|
|
|
private:
|
|
|
|
static int _CompareDebuggers(const TeamDebugger* a,
|
|
|
|
const TeamDebugger* b);
|
|
|
|
static int _FindDebuggerByKey(const team_id* team,
|
|
|
|
const TeamDebugger* debugger);
|
|
|
|
private:
|
|
|
|
typedef BObjectList<TeamDebugger> TeamDebuggerList;
|
|
|
|
|
2016-04-03 00:14:49 +03:00
|
|
|
private:
|
|
|
|
BString fName;
|
2016-04-07 03:55:50 +03:00
|
|
|
TeamDebuggerList fTeamDebuggers;
|
2016-04-03 00:14:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TARGET_HOST_INTERFACE_H
|