Commit Graph

25 Commits

Author SHA1 Message Date
Rene Gollent
9d9c74ecdb 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
2015-08-15 16:47:26 -04:00
Rene Gollent
36a43c9d51 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.
2015-08-14 20:53:06 -04:00
Rene Gollent
9123fde7b9 Debugger: Implement #9783.
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.
2015-07-26 14:37:28 -04:00
Rene Gollent
7d25ab995d Debugger: Add hook for variable value writing.
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.
2015-07-24 17:08:53 -04:00
Rene Gollent
14a55dce06 Debugger: Add signal settings and listener hooks.
Team:
- Add settings and accessors for signal dispositions.
- Add event definitions and listener hooks for signal disposition
  changes.
2015-07-02 22:38:07 -04:00
Rene Gollent
68e78ff841 Debugger: Add memory write support.
- Implements various support classes and functions that will be
  needed in order to marshal requests to write to memory in the
  target team.
2015-05-23 16:54:16 -04:00
Rene Gollent
d1c9ffed34 Debugger: Cleanup.
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.
2014-11-08 18:42:53 -05:00
Rene Gollent
942226c711 Debugger: Add UI for configuring breakpoint conditions.
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.
2014-10-30 16:54:31 -04:00
Rene Gollent
c3f81329bb Debugger: Implement expression variable value resolution.
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.
2014-10-29 17:41:54 -04:00
Rene Gollent
2d5794a1a3 Debugger: Add asynchronous expression evaluation interface.
- 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.
2014-10-28 23:30:01 -04:00
Rene Gollent
432da9e337 Debugger: Implement remaining part of #11033.
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.
2014-08-29 11:04:48 -04:00
Rene Gollent
d44d8207a8 Debugger: Finish handling of missing debug information.
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.
2014-06-15 11:03:24 -04:00
Rene Gollent
cae8421db8 Implement debugger infrastructure for stop on...
...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.
2013-07-07 00:39:04 -04:00
Rene Gollent
5b402aa2a3 Implement #9855.
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.
2013-07-04 10:41:38 -04:00
Rene Gollent
fe448830c9 TeamDebugger: Implement post syscall event handling.
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.
2013-06-28 18:49:32 -04:00
Rene Gollent
442f71a7d9 Extend FunctionSourceCodeRequested().
Now takes an optional boolean parameter to indicate that disassembly is
explicitly being requested. Adjust TeamDebugger and LoadSourceCodeJob's
implementations accordingly.
2013-06-22 15:48:17 -04:00
Rene Gollent
468c8dfab7 Extend UserInterfaceListener to allow marking...
...breakpoints as hidden. Adjust TeamDebugger accordingly.
2013-06-15 14:51:18 -04:00
Rene Gollent
7cbc5a5964 Add UserInterfaceListener hook to request a team restart. 2013-05-29 21:59:51 -04:00
Rene Gollent
c90773b3ba Implement support for restarting teams.
- 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.
2013-05-29 19:25:49 -04:00
Rene Gollent
42d73abab9 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.
2013-05-12 16:03:47 -04:00
Rene Gollent
dd817ff93c Handle team deletion debug event.
When the target team exits, notify the user and shut down the debugger.
2013-04-23 23:05:36 -04:00
Rene Gollent
4e9b38d34e Fix #9221.
- 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.
2012-11-29 08:12:49 -05:00
Rene Gollent
248c2ff45c Rework control flow for debug report generator.
- 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.
2012-11-24 00:44:00 -05:00
Rene Gollent
2efebaa1d1 Tie DebugReportGenerator into TeamDebugger.
- Add UI listener hook. Still needs to be exposed via the actual
  UI though.
2012-11-18 13:10:31 -05:00
Rene Gollent
4549786bad Code reorganization. 2012-11-07 23:19:23 +01:00