Added Architecture and DebuggerInterface to the TeamDebugModel.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31117 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-06-19 15:17:58 +00:00
parent 495676cab6
commit 6383ae9c30
3 changed files with 28 additions and 12 deletions

View File

@ -13,9 +13,12 @@
// #pragma mark - TeamDebugModel
TeamDebugModel::TeamDebugModel(Team* team)
TeamDebugModel::TeamDebugModel(Team* team, DebuggerInterface* debuggerInterface,
Architecture* architecture)
:
fTeam(team)
fTeam(team),
fDebuggerInterface(debuggerInterface),
fArchitecture(architecture)
{
}

View File

@ -14,13 +14,19 @@
//};
class Architecture;
class DebuggerInterface;
class TeamDebugModel {
public:
class Event;
class Listener;
public:
TeamDebugModel(Team* team);
TeamDebugModel(Team* team,
DebuggerInterface* debuggerInterface,
Architecture* architecture);
~TeamDebugModel();
status_t Init();
@ -29,6 +35,10 @@ public:
void Unlock() { fTeam->Unlock(); }
Team* GetTeam() const { return fTeam; }
DebuggerInterface* GetDebuggerInterface() const
{ return fDebuggerInterface; }
Architecture* GetArchitecture() const
{ return fArchitecture; }
void AddListener(Listener* listener);
void RemoveListener(Listener* listener);
@ -38,6 +48,8 @@ private:
private:
Team* fTeam;
DebuggerInterface* fDebuggerInterface;
Architecture* fArchitecture;
ListenerList fListeners;
};

View File

@ -81,15 +81,6 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
fTeam->SetName(teamInfo.args);
// TODO: Set a better name!
// create the team debug model
fDebugModel = new(std::nothrow) TeamDebugModel(fTeam);
if (fDebugModel == NULL)
return B_NO_MEMORY;
error = fDebugModel->Init();
if (error != B_OK)
return error;
// create our worker
fWorker = new(std::nothrow) Worker;
if (fWorker == NULL)
@ -108,6 +99,16 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, bool stopInMain)
if (error != B_OK)
return error;
// create the team debug model
fDebugModel = new(std::nothrow) TeamDebugModel(fTeam, fDebuggerInterface,
fDebuggerInterface->GetArchitecture());
if (fDebugModel == NULL)
return B_NO_MEMORY;
error = fDebugModel->Init();
if (error != B_OK)
return error;
// set team debugging flags
fDebuggerInterface->SetTeamDebuggingFlags(
B_TEAM_DEBUG_THREADS | B_TEAM_DEBUG_IMAGES);