2009-06-16 04:25:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef TEAM_DEBUGGER_H
|
|
|
|
#define TEAM_DEBUGGER_H
|
|
|
|
|
|
|
|
#include <debugger.h>
|
2009-06-17 01:47:49 +04:00
|
|
|
#include <Looper.h>
|
|
|
|
|
2009-06-17 17:40:10 +04:00
|
|
|
#include <debug_support.h>
|
2009-06-17 01:47:49 +04:00
|
|
|
#include <util/DoublyLinkedList.h>
|
|
|
|
|
|
|
|
#include "TeamWindow.h"
|
2009-06-16 04:25:36 +04:00
|
|
|
|
|
|
|
|
|
|
|
class Team;
|
2009-06-18 04:35:12 +04:00
|
|
|
class TeamDebugModel;
|
2009-06-16 04:25:36 +04:00
|
|
|
|
|
|
|
|
2009-06-17 01:47:49 +04:00
|
|
|
class TeamDebugger : public DoublyLinkedListLinkImpl<TeamDebugger>,
|
|
|
|
private BLooper, private TeamWindow::Listener {
|
2009-06-16 04:25:36 +04:00
|
|
|
public:
|
|
|
|
TeamDebugger();
|
|
|
|
~TeamDebugger();
|
|
|
|
|
2009-06-17 01:47:49 +04:00
|
|
|
status_t Init(team_id teamID, thread_id threadID,
|
|
|
|
bool stopInMain);
|
2009-06-16 04:25:36 +04:00
|
|
|
|
2009-06-17 01:47:49 +04:00
|
|
|
team_id TeamID() const { return fTeamID; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
2009-06-16 04:25:36 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static status_t _DebugEventListenerEntry(void* data);
|
|
|
|
status_t _DebugEventListener();
|
|
|
|
|
|
|
|
void _HandleDebuggerMessage(int32 messageCode,
|
|
|
|
const debug_debugger_message_data& message);
|
|
|
|
|
2009-06-17 17:40:10 +04:00
|
|
|
bool _HandleThreadCreated(
|
|
|
|
const debug_thread_created& message);
|
|
|
|
bool _HandleThreadDeleted(
|
|
|
|
const debug_thread_deleted& message);
|
|
|
|
bool _HandleImageCreated(
|
|
|
|
const debug_image_created& message);
|
|
|
|
bool _HandleImageDeleted(
|
|
|
|
const debug_image_deleted& message);
|
|
|
|
|
2009-06-18 04:35:12 +04:00
|
|
|
void _UpdateThreadState(::Thread* thread);
|
|
|
|
|
2009-06-16 04:25:36 +04:00
|
|
|
private:
|
2009-06-17 01:47:49 +04:00
|
|
|
::Team* fTeam;
|
2009-06-18 04:35:12 +04:00
|
|
|
TeamDebugModel* fDebugModel;
|
2009-06-16 04:25:36 +04:00
|
|
|
team_id fTeamID;
|
|
|
|
port_id fDebuggerPort;
|
|
|
|
port_id fNubPort;
|
2009-06-17 17:40:10 +04:00
|
|
|
debug_context fDebugContext;
|
2009-06-16 04:25:36 +04:00
|
|
|
thread_id fDebugEventListener;
|
2009-06-17 01:47:49 +04:00
|
|
|
TeamWindow* fTeamWindow;
|
2009-06-16 04:25:36 +04:00
|
|
|
volatile bool fTerminating;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEAM_DEBUGGER_H
|