diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index 25043899d7..8a47162d4b 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -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& infos) { diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.h b/src/apps/debugger/debugger_interface/DebuggerInterface.h index c700034ce0..bdf9b2c9c9 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.h @@ -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& infos); virtual status_t GetImageInfos(BObjectList& infos); virtual status_t GetSymbolInfos(team_id team, image_id image,