* Added classes to represent source code (SourceCode, Statement).
* Added x86 disassembler (via libudis86). * Added Architecture::DisassembleCode() to disassemble a function to SourceCode. * Added virtual DebugInfo::LoadSourceCode() to retrieve the source code for a given function. The implementation in DebuggerDebugInfo disassembles the function. * Added source code info to StackFrame. Also added a listener mechanism to get notified on source code changes. * Added job to load the source code for a stack frame. * Added (very basic) source code view and wired everything so that when a stack frame is selected the source code (respectively disassembly) for the underlying function is retrieved and shown. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31158 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -233,6 +233,30 @@ TeamDebugger::MessageReceived(BMessage* message)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::StackFrameSourceCodeRequested(TeamWindow* window,
|
||||
StackFrame* frame)
|
||||
{
|
||||
// mark loading
|
||||
AutoLocker< ::Team> locker(fTeam);
|
||||
if (frame->SourceCodeState() != STACK_SOURCE_NOT_LOADED)
|
||||
return;
|
||||
frame->SetSourceCode(NULL, STACK_SOURCE_LOADING);
|
||||
locker.Unlock();
|
||||
|
||||
// schedule the job
|
||||
if (fWorker->ScheduleJob(
|
||||
new(std::nothrow) LoadSourceCodeJob(fDebuggerInterface,
|
||||
fDebuggerInterface->GetArchitecture(), fTeam, frame),
|
||||
this) != B_OK) {
|
||||
// scheduling failed -- mark unavailable
|
||||
locker.Lock();
|
||||
frame->SetSourceCode(NULL, STACK_SOURCE_UNAVAILABLE);
|
||||
locker.Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::ThreadActionRequested(TeamWindow* window, thread_id threadID,
|
||||
uint32 action)
|
||||
@@ -269,6 +293,8 @@ void
|
||||
TeamDebugger::JobAborted(Job* job)
|
||||
{
|
||||
printf("TeamDebugger::JobAborted(%p)\n", job);
|
||||
// TODO: For a stack frame source loader thread we should reset the
|
||||
// loading state! Asynchronously due to locking order.
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user