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
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.
TeamDebugger:
- When we're notified that the target team has called exec(), take all
necessary steps to prepare. These include saving settings for the old
team, clearing out breakpoints, resetting signal dispositions, and
removing the old team's image list. Also set a flag indicating an exec
is pending for later processing.
- On image load notification, if the pending flag is set, check if the
new image is the app image, and if so update the team's name to
the new image, load that respective team's settings, and set a
temporary breakpoint in its main() so the user has a chance to
perform any additional desired actions before starting execution
in the new executable.
WriteValueNodeJob:
- Implement async job that creates a ValueWriter to update a variable
value on request.
UserInterfaceListener:
- Add hook for requesting that a node be updated with a new value.
Implement in TeamDebugger by scheduling a WriteValueNodeJob.
Team:
- Remove expression evaluation event / listener hook. This doesn't
really belong to the Team anyways.
UserInterfaceListener:
- ExpressionEvaluationRequested() now takes an ExpressionInfo object
rather than the individual subcomponents.
ExpressionEvaluationJob:
- Notification of expression evaluation completion is now handled
via the info object's listener interface rather than the Team.
Others:
- Adjust all users of expressions to set themselves up as
ExpressionInfo::Listener subclasses, and consequently add themselves
to the respective info object when requesting evaluation. This
significantly simplifies various things, and also ensures that no
one accidentally gets notified of an expression they didn't actually
ask for, which could occur with the previous Team-based listener
interface. Make all other required adjustments for new interface
usage.
No functional change intended.
General:
- Add message codes for requesting breakpoint configuration.
UserInterfaceListener/TeamDebugger:
- Add/implement hooks for requesting breakpoint condition changes.
BreakpointsView:
- Add button to request editing the currently selected breakpoint's
condition.
TeamWindow:
- Handle request to show breakpoint edit window.
BreakpointEditWindow:
- Implement simple radio-based UI for modifying the current breakpoint's
condition.
Still missing: Actually handling/evaluating the breakpoint conditions in
the ThreadHandler when the breakpoint is hit.
General:
- Resolving variable values requires both a stack frame and a CPU state.
Adjust all interfaces and callers accordingly.
ExpressionEvaluationJob:
- Pass additional parameters needed for variable value resolution.
- If variable resolution is desired, ExpressionEvaluationJob now
creates a temporary ValueNodeManager for that purpose.
- If the expression parser returns a value node pointer that needs
to be resolved, schedule a corresponding job and wait.
CLanguageExpressionEvaluator:
- Clean up some leftovers that were preventing variable names from being
handled properly in some cases.
- Implement handling of identifier names. These are now looked up against
the value node graph of the active node manager, and if found, corresponding
values are retrieved. If the value has not yet been resolved, an exception
is thrown to ask that to be done.
This gets value resolution working for basic local variables and function
parameters, and consequently, #9712. Structure/class members and/or pointer
indirection aren't yet handled.
- Add UserInterfaceListener hook to request expression evaluation.
- Add corresponding events/handlers in Team and TeamDebugger.
These allow callers to request evaluation of expressions by the
debugger core's worker threads with asynchronous notifications of
results. While not strictly necessary right now, this paves the way
for further changes to come, as handling of variables will
potentially require resolving their values if they haven't been
already, and this shouldn't be done from user interface threads.
TeamDebugInfo:
- Add function to invalidate a source entry's file mapping.
UserInterfaceListener:
- Add listener hook to be able to invoke the aforementioned invalidate.
Add corresponding implementation in TeamDebugger.
FileManager:
- When asked to locate a source entry, invalidate any existing mapping
first.
TeamWindow:
- Always allow choosing an alternate source file.
- If we already have an existing source mapping, invalidate it first
before attempting to establish a new one.
Add a listener interface for LoadImageDebugInfoJob that allows it to request
user assistance based on its current state. Adjust callers to pass in said
listener accordingly.
Implement the aforementioned listener interface in TeamDebugger, and use the
loading state handler roster to find the appropriate handler / handle the request.
This implements most of what's needed for #10138, the main piece still missing
is for the dwarf handler to detect whether the image in question comes from a package,
and if so, to offer to install the corresponding debug information package rather than
locating the file manually, assuming such a package exists.
...image load with name matching.
- Move the stop on image load setting to Team, along with a new setting
governing the use of the (also newly added) name list.
- Add accessors for maintaining the name list, and events/notifications
for listeners with regards to changes to all stop on image load
settings.
- Adjust user interface listener hooks for additional functionality.
The Team menu now has a menu item allowing one to tell the debugger to
stop whenever a new executable image is loaded by the debugged team.
This setting is not currently persisted, though that can be changed if
desired.
We now watch for file write syscalls in the target team. If they
constitute a write to either stdout or stderr, we attempt to capture the
output, and notify interested listeners accordingly.
Now takes an optional boolean parameter to indicate that disassembly is
explicitly being requested. Adjust TeamDebugger and LoadSourceCodeJob's
implementations accordingly.
- TeamDebugger's listener interface now exports a
TeamDebuggerRestartRequested hook. The latter is used to request
starting a new debugger instance with the same arguments/settings as the
team it represented. Implemented for the graphical debugger.
- When a team terminates, the resulting dialog now allows the user to
choose to quit, restart, or simply do nothing. The latter option still
needs some work though, as e.g. setting additional breakpoints currently
fails since the corresponding debugger interface is no longer around.
Implements the main part of #9774.
- 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.
- When an image creation notification is received, the thread
that provoked it needs to be suspended until the debugger has
finished loading the image's debug information. Otherwise, if that
image had a breakpoint in it, it was possible that the thread would
execute past the code where the breakpoint should be before the
debugger had a chance to actually install it.
- Only update breakpoints when debug info loading has actually finished.
- DebugReportGenerator is now its own BLooper that generates reports asynchronously
instead of in TeamDebugger's message loop.
- If a stack trace isn't yet available, DebugReportGenerator now waits for it to
be generated.
- Extended Team to add a listener event for report generation completing. DebugReportGenerator
now generates such an event when it has finished writing a report.