Debugger: Adjust ThreadHandler.
- SetBreakpointAndRun() now takes an additional argument indicating if this invocation is for a fresh run of a team or not, as continuing the thread's execution needs to be done differently in the two cases.
This commit is contained in:
@@ -119,16 +119,22 @@ ThreadHandler::Init()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ThreadHandler::SetBreakpointAndRun(target_addr_t address)
|
ThreadHandler::SetBreakpointAndRun(target_addr_t address, bool initialStart)
|
||||||
{
|
{
|
||||||
status_t error = _InstallTemporaryBreakpoint(address);
|
status_t error = _InstallTemporaryBreakpoint(address);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
fPreviousInstructionPointer = 0;
|
fPreviousInstructionPointer = 0;
|
||||||
resume_thread(ThreadID());
|
// when the program is first run, the initial thread is not yet under
|
||||||
|
// the control of the debug nub, so it needs to be resumed rather than
|
||||||
|
// continued.
|
||||||
|
if (initialStart) {
|
||||||
|
resume_thread(ThreadID());
|
||||||
// TODO: This should probably better be a DebuggerInterface method,
|
// TODO: This should probably better be a DebuggerInterface method,
|
||||||
// but this method is used only when debugging a local team anyway.
|
// but this method is used only when debugging a local team anyway.
|
||||||
|
} else
|
||||||
|
fDebuggerInterface->ContinueThread(ThreadID());
|
||||||
// Pretend "step out" mode, so that the temporary breakpoint hit will not
|
// Pretend "step out" mode, so that the temporary breakpoint hit will not
|
||||||
// be ignored.
|
// be ignored.
|
||||||
fStepMode = STEP_OUT;
|
fStepMode = STEP_OUT;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public:
|
|||||||
thread_id ThreadID() const { return fThread->ID(); }
|
thread_id ThreadID() const { return fThread->ID(); }
|
||||||
Thread* GetThread() const { return fThread; }
|
Thread* GetThread() const { return fThread; }
|
||||||
|
|
||||||
status_t SetBreakpointAndRun(target_addr_t address);
|
status_t SetBreakpointAndRun(target_addr_t address,
|
||||||
|
bool initialStart = true);
|
||||||
// team lock held
|
// team lock held
|
||||||
|
|
||||||
// All Handle*() methods are invoked in team debugger thread,
|
// All Handle*() methods are invoked in team debugger thread,
|
||||||
|
|||||||
Reference in New Issue
Block a user