Debugger: Implement notifications for debug info loading.
TeamDebugger: - When notified that an image debug info job has started loading, notify the user interface accordingly. Also reset status to a ready state whenever all in-flight jobs are complete. This allows the user to know when then debug subsystem is still in the process of parsing debug information, as this can be time consuming for larger programs/libraries.
This commit is contained in:
@@ -1373,6 +1373,7 @@ void
|
||||
TeamDebugger::JobDone(Job* job)
|
||||
{
|
||||
TRACE_JOBS("TeamDebugger::JobDone(%p)\n", job);
|
||||
_ResetUserBackgroundStatusIfNeeded();
|
||||
}
|
||||
|
||||
|
||||
@@ -1381,6 +1382,7 @@ TeamDebugger::JobFailed(Job* job)
|
||||
{
|
||||
TRACE_JOBS("TeamDebugger::JobFailed(%p)\n", job);
|
||||
// TODO: notify user
|
||||
_ResetUserBackgroundStatusIfNeeded();
|
||||
}
|
||||
|
||||
|
||||
@@ -1390,6 +1392,7 @@ TeamDebugger::JobAborted(Job* job)
|
||||
TRACE_JOBS("TeamDebugger::JobAborted(%p)\n", job);
|
||||
// TODO: For a stack frame source loader thread we should reset the
|
||||
// loading state! Asynchronously due to locking order.
|
||||
_ResetUserBackgroundStatusIfNeeded();
|
||||
}
|
||||
|
||||
|
||||
@@ -1407,6 +1410,16 @@ TeamDebugger::ImageDebugInfoJobNeedsUserInput(Job* job,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::ImageDebugInfoJobInProgress(Image* image)
|
||||
{
|
||||
BString message;
|
||||
message.SetToFormat("Loading debug information for %s...",
|
||||
image->Name().String());
|
||||
fUserInterface->NotifyBackgroundWorkStatus(message.String());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::ThreadStateChanged(const ::Team::ThreadEvent& event)
|
||||
{
|
||||
@@ -1908,7 +1921,6 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id imageID)
|
||||
|
||||
bool handlePostExecSetup = fExecPending && image->Type() == B_APP_IMAGE
|
||||
&& state != IMAGE_DEBUG_INFO_LOADING;
|
||||
|
||||
// this needs to be done first so that breakpoints are loaded.
|
||||
// otherwise, UpdateImageBreakpoints() won't find the appropriate
|
||||
// UserBreakpoints to create/install instances for.
|
||||
@@ -1922,6 +1934,7 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id imageID)
|
||||
|
||||
if (state == IMAGE_DEBUG_INFO_LOADED
|
||||
|| state == IMAGE_DEBUG_INFO_UNAVAILABLE) {
|
||||
|
||||
// update breakpoints in the image
|
||||
fBreakpointManager->UpdateImageBreakpoints(image);
|
||||
|
||||
@@ -2486,6 +2499,14 @@ TeamDebugger::_NotifyUser(const char* title, const char* text,...)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamDebugger::_ResetUserBackgroundStatusIfNeeded()
|
||||
{
|
||||
if (!fWorker->HasPendingJobs())
|
||||
fUserInterface->NotifyBackgroundWorkStatus("Ready.");
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - Listener
|
||||
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ private:
|
||||
|
||||
virtual void ImageDebugInfoJobNeedsUserInput(Job* job,
|
||||
ImageDebugInfoLoadingState* state);
|
||||
virtual void ImageDebugInfoJobInProgress(Image* image);
|
||||
|
||||
// Team::Listener
|
||||
virtual void ThreadStateChanged(
|
||||
@@ -235,6 +236,11 @@ private:
|
||||
void _NotifyUser(const char* title,
|
||||
const char* text,...);
|
||||
|
||||
void _ResetUserBackgroundStatusIfNeeded();
|
||||
// updates user interface to
|
||||
// ready/completed message
|
||||
// for background work status
|
||||
|
||||
private:
|
||||
Listener* fListener;
|
||||
SettingsManager* fSettingsManager;
|
||||
|
||||
Reference in New Issue
Block a user