The Team menu now has a menu item allowing one to tell the debugger to
stop whenever a new executable image is loaded by the debugged team.
This setting is not currently persisted, though that can be changed if
desired.
This commit is contained in:
Rene Gollent
2013-07-04 10:41:38 -04:00
parent e818b9707c
commit 5b402aa2a3
5 changed files with 54 additions and 7 deletions
+31 -3
View File
@@ -15,6 +15,7 @@
#include <Entry.h>
#include <Message.h>
#include <AutoDeleter.h>
#include <AutoLocker.h>
#include "debug_utils.h"
@@ -222,7 +223,8 @@ TeamDebugger::TeamDebugger(Listener* listener, UserInterface* userInterface,
fTerminating(false),
fKillTeamOnQuit(false),
fCommandLineArgc(0),
fCommandLineArgv(NULL)
fCommandLineArgv(NULL),
fStopOnImageLoad(false)
{
fUserInterface->AcquireReference();
}
@@ -603,6 +605,16 @@ TeamDebugger::MessageReceived(BMessage* message)
break;
}
case MSG_STOP_ON_IMAGE_LOAD:
{
bool enabled;
if (message->FindBool("enabled", &enabled) != B_OK)
break;
fStopOnImageLoad = enabled;
break;
}
case MSG_SET_WATCHPOINT:
case MSG_CLEAR_WATCHPOINT:
{
@@ -886,6 +898,15 @@ TeamDebugger::ClearBreakpointRequested(target_addr_t address)
}
void
TeamDebugger::SetStopOnImageLoadRequested(bool enabled)
{
BMessage message(MSG_STOP_ON_IMAGE_LOAD);
message.AddBool("enabled", enabled);
PostMessage(&message);
}
void
TeamDebugger::ClearBreakpointRequested(UserBreakpoint* breakpoint)
{
@@ -1502,9 +1523,16 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id imageID)
ImageInfoPendingThread* thread = fImageInfoPendingThreads
->Lookup(imageID);
if (thread != NULL) {
fDebuggerInterface->ContinueThread(thread->ThreadID());
fImageInfoPendingThreads->Remove(thread);
delete thread;
ObjectDeleter<ImageInfoPendingThread> threadDeleter(thread);
if (fStopOnImageLoad) {
ThreadHandler* handler = _GetThreadHandler(thread->ThreadID());
BReference<ThreadHandler> handlerReference(handler);
if (handler != NULL && handler->HandleThreadDebugged(NULL))
return;
}
fDebuggerInterface->ContinueThread(thread->ThreadID());
}
}
}