Commit Graph

790 Commits

Author SHA1 Message Date
Rene Gollent
4dc355e9a9 Adjust debug_utils functions.
The functions in question now return an error rather than simply calling
exit() directly when they fail, as this behavior wasn't acceptable for
e.g. Debugger. Adjusted all calling apps accordingly.
2013-06-28 18:49:28 -04:00
Rene Gollent
23f48a24d0 Add event class for the post-syscall debug message. 2013-06-28 18:49:26 -04:00
Rene Gollent
d08227bb68 Add SyscallInfoEvent model class. 2013-06-28 18:49:24 -04:00
Rene Gollent
54574eda59 Correct locking error. 2013-06-25 20:35:09 -04:00
Rene Gollent
bbbe023af3 InspectorWindow: slight behaviorial tweak in failure case.
Don't release the reference to the current block until we get the
notification that the next block has been retrieved. Otherwise, the
previous/next block buttons would cease to work if the requested block
failed to be retrieved.
2013-06-25 18:03:49 -04:00
Rene Gollent
b906e10a5d Fix crash in InspectorWindow.
- In the case where retrieval of a memory block failed, InspectorWindow
didn't handle the notification. Consequently, it never removed itself as
a listener from the failed block, nor did it release its reference for
it. Consequently, if one attempted to retrieve data from the same block
again, walking the listener list would crash due to the already-deleted
entry in the list.

- The success case had the same problem with regards to not removing its
listener, but was masked by virtue of the inspector currently being the
only user of the memory block manager, so in the latter case the blocks
would be properly released/destroyed and the aforementioned walk would
never occur.

- Adjust locking a bit to ensure that manipulating the listener list
always happens with the team lock held.

- Style fixes.
2013-06-25 17:42:06 -04:00
Rene Gollent
2214cb57ee Fix regression introduced in 21d8063.
We can't use BPath to get the filename for the source file path embedded
in the debug information, since it may be relative, which BPath will try to
normalize.
2013-06-25 17:00:54 -04:00
Rene Gollent
dc5cd9e4db Style fix. 2013-06-23 13:06:50 -04:00
Rene Gollent
6eb68a0430 Slight tweak to inactive instruction pointer highlight color. 2013-06-23 08:10:10 -04:00
Rene Gollent
b1975a590f Implement #9775.
- When possible, SourceView now adds a context menu option to switch
between source and disassembly. If the disassembled code is not yet
available, it is asynchronously requested. Adjusted SourceView::Listener
and implementing subclasses accordingly to make that request feasible.

- Adjust TeamWindow to correctly deal with the possibility of the
function source code being available but not loaded.
2013-06-22 16:01:58 -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
ecd9ecb132 Add missing error check. 2013-06-21 18:54:55 -04:00
Rene Gollent
21d8063591 Slight tweak to located file handling.
- When the user helps locate a missing source file, verify that the
source and located file names match. If they don't, prompt the user to
verify that they did in fact intend to choose the file in question.
Helps avoid accidentally clicking the wrong file when performing
location.
2013-06-21 18:54:55 -04:00
Rene Gollent
143fdaf7cf Style fix. 2013-06-21 18:54:54 -04:00
Rene Gollent
77d2c53ce7 Slight tweak to instruction pointer highlight drawing.
- When highlighting lines that match IPs in the current stack trace,
draw those which aren't from the currently selected frame in a lighter
color, so as to make it more clear which is which when multiple calls
are visible at once.
2013-06-19 18:38:20 -04:00
Rene Gollent
0c2d190d67 Fix incorrect handling when starting new teams.
When building the launch string for starting a new team via the GUI,
enclose the executable path in quotes to ensure paths with spaces are
handled properly.
2013-06-16 11:09:57 -04:00
Rene Gollent
607d59a103 ExceptionConfigWindow: detect current exception status...
...on startup by seeing if the breakpoints for the exception functions
are already installed or not.
2013-06-15 14:51:19 -04:00
Rene Gollent
7287380095 BreakpointListView/SourceView: ignore hidden breakpoints. 2013-06-15 14:51:19 -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
b9461dc8cd Add hidden attribute to UserBreakpoint.
Marks a breakpoint as one that should not be exposed in the UI's normal
breakpoint management interface. Adjust settings management to
preserve/restore appropriately.
2013-06-15 14:51:17 -04:00
Rene Gollent
41bf99064c Implement throw exception breakpoints.
The exception thrown checkbox now tries to set/clear breakpoints for
gcc2/4's respective exception throwing functions. Some tweaking still
needs to be done in order that these aren't visible in the breakpoints
list like normal user set breakpoints.
2013-06-15 14:51:16 -04:00
Rene Gollent
944297b82b Add hooks for actually showing/managing exception config window. 2013-06-15 14:51:16 -04:00
Rene Gollent
f4d95e0e19 Slightly rearrange BreakpointsView.
Line up the buttons along the bottom rather than the side.
Add button to invoke exception configuration window.
2013-06-15 14:51:15 -04:00
Rene Gollent
55fc8da143 Initial implementation of exception configuration window.
Doesn't actually take any actions yet, just presents a UI.
2013-06-15 14:51:14 -04:00
Rene Gollent
7e6a958b0b Fix regression introduced in 6b308faf.
That commit switched to a single string column for representing
breakpoint locations, but neglected to update the case of a breakpoint
in a non-debug function to actually format the address as a string
appropriately, leading to those simply showing no data since then.
2013-06-07 22:32:32 -04:00
Rene Gollent
07842a5be0 Fall back to disassembly in case typecast fails.
Since some time now, we construct minimal dwarf image debug infos
for release images if they contain frame unwind information, in order
to allow using that to unwind the stack in as many cases as possible.
As such, it's  entirely possible that such an image may be asked for
statement information regarding a function that isn't in fact compiled
with debugging. As such, we need to simply fall back to disassembly
rather than failing entirely. Fixes setting breakpoints in such
functions (i.e. anything in a release version of libstdc++).
2013-06-07 22:16:38 -04:00
Rene Gollent
37e0f72711 Slight tweak to filtered node expansion logic.
When a filter is active, only expand parent nodes if either a) there is
only one matching parent, or 2) the match actually hit a function
contained in it. This allows the case where the intent of the filter is
to find a particular set of files or subdirectories to be handled more
efficiently.
2013-06-06 18:24:37 -04:00
Rene Gollent
8b98295a68 Redo filtering to use new RegExp classes.
ImageFunctionsView's filtering field now allows shell-style glob matches
rather than just simple direct string matches. Implements remaining
part of #7955.
2013-06-05 22:02:45 -04:00
Rene Gollent
faa0580b62 Optimizations to filter match drawing.
Store the filter match index on the SourcePathComponentNode so we can
retrieve it directly when drawing instead of having to recompute the
position of the match every time.
2013-06-05 22:02:44 -04:00
Rene Gollent
58535f5a9a Initial implementation of #9755.
- ImageFunctionsView now contains a text input allowing one to specify a
filter for its contained functions.
- When in filtered mode, the previous flattened view is used rather than
the hierarchical tree.
- The matching portion of the string is highlighted. However, currently
only simple string matches are supported.
2013-06-05 22:02:42 -04:00
Rene Gollent
cebb446f55 BreakpointManager: Adjust breakpoint installation logic.
If the debugger interface isn't currently connected, don't attempt to
actually install the breakpoint, and simply consider the operation a
success. This allows setting new breakpoints after e.g. the team has
exited.

Resolves remaining part of #9774.
2013-05-30 21:15:33 -04:00
Rene Gollent
6443c430b2 TeamDebugger: minor cleanups.
- On team exit, close the debug interface.
- When receiving a restart request via the listener, save settings
before dispatching it.
2013-05-30 21:15:33 -04:00
Rene Gollent
05d98101be DebuggerInterface: reset port IDs on Close()...
...and add accessor to detect whether we currently have a valid
connection or not.
2013-05-30 21:15:32 -04:00
Rene Gollent
8835205cf6 Sentence casing corrections, no functional change. 2013-05-29 23:34:43 -04:00
Rene Gollent
dd33ff02fd Add menu item to request team restart. 2013-05-29 22:01:32 -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
2f6ecd577a Add parsing for several new attribute classes.
- Collectively the previous set of changes get us minimally parsing
some of the new DWARF4 output from gcc 4.7 as well as some of the
draft DWARF5 extensions, which allows us to handle such executables
a bit more gracefully. Not all of the new information is made use of
as yet though. Should resolve #9799.
2013-05-28 22:36:56 -04:00
Rene Gollent
54a0525eca DIESubprogram: Add parsing for main subprogram attribute.
- Will be used later to recognize the main function of a given program.
2013-05-28 22:36:55 -04:00
Rene Gollent
cc428f5bbf Sync definitions with DWARF4 + DWARF5 drafts.
- Add tag, attribute and form definitions from DWARF4, as well as some
  from DWARF5 draft proposals that gcc4.7 is now emitting.
- Add corresponding attribute getter/setters and class definitions.
- Add appropriate attribute class definitions.
- Update tag name and attribute name retrieval accordingly for the
  above.
- Implement barebones DIECallSite/DIECallSiteParameter.
2013-05-28 22:36:33 -04:00
Rene Gollent
a6543e68c0 When an exception/breakpoint is hit, activate...
...the team window. Resolves #9797.
2013-05-27 22:01:17 -04:00
Siarzhuk Zharski
3bbef9dd76 Discard Termcap and switch console apps to use Terminfo
* Switch bash, debugger, less, telnet[d] and top apps to use termcap
  functionality provided by ncurses lib instead of GNU libtermcap.so;
* NetBSD version of tput utility replaced with ncurses' one. Fixes #9606;
* terminfo database is provided as mandatory package installed during
  building target system;
* Remove libtermcap module. The termcap database source and
  corresponding build rules are not removed to provide backward compatibility -
  until all optional packages will be rebuild on upcoming system version
  using terminfo. Note that gcc2 builds may require to provide termcap a bit
  longer in the sake of binary compatibility with R5 era apps.
2013-05-23 14:07:50 +02:00
Rene Gollent
325f7bb4ec Show correct type in case a typecast has taken place. 2013-05-21 17:37:50 -04:00
Rene Gollent
e312ed26ef Add "Cast to array" context option.
Implements a simple context shortcut allowing to cast a pointer variable
directly to a 10-element array of the type it points to. Resolves #9778.
2013-05-20 19:03:55 -04:00
Rene Gollent
f297d6591d Relax range setting constraints for arrays.
- VariablesView now detects if a container's range is fixed or not,
and uses that to adjust both the prompt it displays and whether or not
the parsed ranges are bounds checked.
- ArrayValueNode now returns the currently user-set range rather than
the dimension constraints, since those might not always be accurate.
2013-05-20 19:03:53 -04:00
Rene Gollent
570241e8b7 Extend ValueNode interface for ranged containers.
Add an IsContainerRangeFixed() hook which specifies whether or not
the container in question can only display elements within a fixed
lower/upper bound, i.e. B{Object}List.
2013-05-20 19:03:52 -04:00
Rene Gollent
6b308faf1e Implement #9777.
- Introduce class BreakpointProxy which acts as a container for
either a breakpoint or a watchpoint. BreakpointsTableModel now stores
a single list of these rather than separate Breakpoint/Watchpoint lists.
- Switch BreakpointListView to allow multiple selection mode, and
consequently change selection/listener interfaces to use a list of
BreakpointProxy objects. Adjust implementors accordingly.
- Rework breakpoint list columns to better mesh with a unified display
of breakpoint and watchpoint information.
- Add an input filter to handle removing breakpoints when the delete
key is pressed.
2013-05-19 21:38:59 -04:00
Rene Gollent
d51ab41d49 Fix oversight in set visible range support.
Detect the case where we have a pointer to an array type, as seen
when typecasting a pointer to an array, and present the set visible
range option for these as well.
2013-05-17 22:06:04 -04:00
Rene Gollent
c05a041eac Add Type column to VariablesView. Resolves #9779. 2013-05-17 20:43:10 -04:00
Rene Gollent
c81a7bda64 Refactor DIE name resolution.
Factor out DwarfUtils::GetDIETypeName(). Make use of it for both
Subprogram parameters and modified types in general. Resolves TODO.
2013-05-17 20:43:09 -04:00