Added a few classes to the debug kit:

* BDebugMessageHandler: Interface with hooks for handling of debug messages.
* BDebugContext: Essentially a C++ wrapper for struct debug_context, with
  handy methods for controlling a debugged team.
* BTeamDebugger: Proxy for a debugged team. Derived from BDebugContext.
* BDebugLooper: Wraps a main debug message loop. Any number of BTeamDebuggers
  can be added and associated with BDebugMessageHandlers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35953 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-03-26 00:15:59 +00:00
parent adfe871902
commit 53446ebf80
9 changed files with 1161 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _DEBUG_CONTEXT_H
#define _DEBUG_CONTEXT_H
#include <debug_support.h>
class BDebugContext {
public:
BDebugContext();
~BDebugContext();
status_t Init(team_id team, port_id nubPort);
void Uninit();
team_id Team() const { return fContext.team; }
port_id NubPort() const { return fContext.nub_port; }
port_id ReplyPort() const
{ return fContext.reply_port; }
status_t SendDebugMessage(int32 messageCode,
const void *message, size_t messageSize,
void* reply, size_t replySize);
status_t SetTeamDebuggingFlags(int32 flags);
ssize_t ReadMemoryPartial(const void* address,
void* buffer, size_t size);
ssize_t ReadMemory(const void* address,
void* buffer, size_t size);
ssize_t ReadString(const void* address,
char* buffer, size_t size);
status_t SetBreakpoint(void* address);
status_t ClearBreakpoint(void* address);
status_t SetWatchpoint(void* address, uint32 type,
int32 length);
status_t ClearWatchpoint(void* address);
status_t ContinueThread(thread_id thread);
status_t SetThreadDebuggingFlags(thread_id thread,
int32 flags);
status_t GetThreadCpuState(thread_id thread,
debug_debugger_message* _messageCode,
debug_cpu_state* cpuState);
protected:
debug_context fContext;
};
#endif // _DEBUG_CONTEXT_H