Add "Run to cursor" context action.

- UserInterfaceListener/TeamDebugger: Extend ThreadActionRequested()
  to allow passing a target address. Adjust TeamDebugger's
  implementation accordingly.

- ThreadHandler: The MSG_THREAD_RUN action can now optionally take an
  address parameter to run until. If this is specified, set a temporary
  breakpoint for said address before resuming execution.

- SourceView: On right click, present a context menu showing possible
  actions for the current line if we're currently in a stopped thread.
  For the moment, this only yields the "Run to cursor" action, but
  more will be added in the future.
This commit is contained in:
Rene Gollent
2013-05-12 16:03:47 -04:00
parent 7a361a7a19
commit 42d73abab9
9 changed files with 164 additions and 23 deletions
@@ -536,11 +536,15 @@ TeamDebugger::MessageReceived(BMessage* message)
case MSG_THREAD_STEP_OUT:
{
int32 threadID;
target_addr_t address;
if (message->FindInt32("thread", &threadID) != B_OK)
break;
if (message->FindUInt64("address", &address) != B_OK)
address = 0;
if (ThreadHandler* handler = _GetThreadHandler(threadID)) {
handler->HandleThreadAction(message->what);
handler->HandleThreadAction(message->what, address);
handler->ReleaseReference();
}
break;
@@ -801,10 +805,11 @@ TeamDebugger::ValueNodeValueRequested(CpuState* cpuState,
void
TeamDebugger::ThreadActionRequested(thread_id threadID,
uint32 action)
uint32 action, target_addr_t address)
{
BMessage message(action);
message.AddInt32("thread", threadID);
message.AddUInt64("address", address);
PostMessage(&message);
}