Add watchpoint support in DebuggerInterface.

This commit is contained in:
Rene Gollent 2012-11-05 19:15:46 +01:00 committed by Alexander von Gluck IV
parent a1a6f98a47
commit cb51c20c26
2 changed files with 40 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2010, Rene Gollent, rene@gollent.com.
* Copyright 2010-2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
@ -425,6 +425,40 @@ DebuggerInterface::UninstallBreakpoint(target_addr_t address)
}
status_t
DebuggerInterface::InstallWatchpoint(target_addr_t address, uint32 type,
int32 length)
{
DebugContextGetter contextGetter(fDebugContextPool);
debug_nub_set_watchpoint message;
message.reply_port = contextGetter.Context()->reply_port;
message.address = (void*)(addr_t)address;
message.type = type;
message.length = length;
debug_nub_set_watchpoint_reply reply;
status_t error = send_debug_message(contextGetter.Context(),
B_DEBUG_MESSAGE_SET_WATCHPOINT, &message, sizeof(message), &reply,
sizeof(reply));
return error == B_OK ? reply.error : error;
}
status_t
DebuggerInterface::UninstallWatchpoint(target_addr_t address)
{
DebugContextGetter contextGetter(fDebugContextPool);
debug_nub_clear_watchpoint message;
message.address = (void*)(addr_t)address;
return write_port(fNubPort, B_DEBUG_MESSAGE_CLEAR_WATCHPOINT,
&message, sizeof(message));
}
status_t
DebuggerInterface::GetThreadInfos(BObjectList<ThreadInfo>& infos)
{

View File

@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2010, Rene Gollent, rene@gollent.com.
* Copyright 2010-2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef DEBUGGER_INTERFACE_H
@ -48,6 +48,10 @@ public:
virtual status_t InstallBreakpoint(target_addr_t address);
virtual status_t UninstallBreakpoint(target_addr_t address);
virtual status_t InstallWatchpoint(target_addr_t address,
uint32 type, int32 length);
virtual status_t UninstallWatchpoint(target_addr_t address);
virtual status_t GetThreadInfos(BObjectList<ThreadInfo>& infos);
virtual status_t GetImageInfos(BObjectList<ImageInfo>& infos);
virtual status_t GetSymbolInfos(team_id team, image_id image,