Debugger: Cleanups and improvements for status notification.

Worker/Job:
- Add job listener hooks for when work actually begins for a job,
  and when a job is suspended to wait for user input.
- Add hook for setting a job description string, and implement in several
  subclasses.

LoadImageDebugInfoJob:
- Get rid of ImageDebugInfoJobListener since its functionality can be
  handled via the more general job wait for user input hook. Refactor
  accordingly.

TeamDebugger:
- Adjust to use new job hooks. When a worker job is initiated, we now
  check if the job has a description, and if so pass it on to the UI
  to display a notification.

DwarfLoadingStateHandler:
- Notify the UI when a package download is in progress.

With these changes, the status bar now notifies the user if any of the
following actions are in flight:

1) Loading/parsing debug information
2) Stack trace retrieval
3) Source code retrieval
4) Downloading a debug info package
This commit is contained in:
Rene Gollent
2015-08-15 16:47:26 -04:00
parent 4c7fff8044
commit 9d9c74ecdb
11 changed files with 110 additions and 106 deletions
@@ -76,14 +76,13 @@ private:
ThreadHandler::ThreadHandler(Thread* thread, Worker* worker,
DebuggerInterface* debuggerInterface,
ImageDebugInfoJobListener* listener,
DebuggerInterface* debuggerInterface, JobListener* jobListener,
BreakpointManager* breakpointManager)
:
fThread(thread),
fWorker(worker),
fDebuggerInterface(debuggerInterface),
fDebugInfoJobListener(listener),
fJobListener(jobListener),
fBreakpointManager(breakpointManager),
fStepMode(STEP_NONE),
fStepStatement(NULL),
@@ -113,7 +112,7 @@ void
ThreadHandler::Init()
{
fWorker->ScheduleJob(new(std::nothrow) GetThreadStateJob(fDebuggerInterface,
fThread));
fThread), fJobListener);
fConditionWaitSem = create_sem(0, "breakpoint condition waiter");
}
@@ -458,7 +457,8 @@ ThreadHandler::HandleThreadStateChanged()
if (fThread->State() == THREAD_STATE_STOPPED
&& fThread->GetCpuState() == NULL) {
fWorker->ScheduleJob(
new(std::nothrow) GetCpuStateJob(fDebuggerInterface, fThread));
new(std::nothrow) GetCpuStateJob(fDebuggerInterface, fThread),
fJobListener);
}
}
@@ -475,8 +475,8 @@ ThreadHandler::HandleCpuStateChanged()
if (fThread->GetCpuState() != NULL && fThread->GetStackTrace() == NULL) {
fWorker->ScheduleJob(
new(std::nothrow) GetStackTraceJob(fDebuggerInterface,
fDebugInfoJobListener, fDebuggerInterface->GetArchitecture(),
fThread));
fJobListener, fDebuggerInterface->GetArchitecture(),
fThread), fJobListener);
}
}
@@ -954,7 +954,8 @@ ThreadHandler::_HandleBreakpointConditionIfNeeded(CpuState* cpuState)
status_t error = fWorker->ScheduleJob(
new(std::nothrow) ExpressionEvaluationJob(fThread->GetTeam(),
fDebuggerInterface, language, expressionInfo, frame, fThread));
fDebuggerInterface, language, expressionInfo, frame, fThread),
fJobListener);
BPrivate::ObjectDeleter<ExpressionEvaluationListener> deleter(
listener);