Commit Graph

286 Commits

Author SHA1 Message Date
Friedemann Kleint
e87bd302da Debugger: Protect reloadRegisters against early calls.
Check for correct state (InferiorStopped).
2009-11-30 16:45:15 +01:00
Daniel Molkentin
40518ac11c gdb: On Windows, also substitute the debugging path for non-sdk Qt.
Reviewed-By: hjk
2009-11-19 19:45:14 +01:00
hjk
516af4b1b6 debugger: access preloaded dumpers also when stopped by a signal 2009-11-13 14:16:44 +01:00
Oswald Buddenhagen
0939a7f77f don't track shared library events on gdb < 7, after all.
The problem is that the shlib events disturb bounded execution requests
and there is no way to recover from this - the debugger will effectively
turn "step over" into "continue". this is nicely explained in
http://vladimir_prus.blogspot.com/2007/12/debugger-stories-pending-breakpoints.html
2009-11-12 15:36:45 +01:00
hjk
79789d4feb debugger: let dumpers override reported inames 2009-11-12 09:25:41 +01:00
Oswald Buddenhagen
4d45ad0003 always clear pending command queue before posting shutdown commands
this ensures that, among other things, we won't get into this scenario:
- process is running
- interrupt is requested by user
- termination is requested by user
- before interrupt takes effect, the process terminates
=> shutdown is called
=> exit is also queued, as there is already a queued kill
=> nothing happens, as there will never be a stop response

Reviewed-by: hjk
2009-11-11 12:41:06 +01:00
Oswald Buddenhagen
5bd5fa63bf be more lenient when matching the stops at _start
archer reports stops at tbreaks properly, so checking for an empty stop
reason is no particularly good idea. instead, we simply skip *all* stops
at the entry point, assuming the user will not really set a breakpoint
there anyway.

Reviewed-by: hjk
2009-11-11 11:42:12 +01:00
Jarek Kobus
4e4adc865a Provide disambiguations for "unknown" string 2009-11-10 16:22:40 +01:00
Oswald Buddenhagen
cb4b139148 track shared library events even on gdb < 7
this is to update breakpoint, source and module lists automatically.

also remove the now pointless -break-list on every stop.

Reviewed-by: hjk
2009-11-10 13:02:34 +01:00
Oswald Buddenhagen
de9438df0c clear pending stream outputs after handling stop response
any output will most definitely belong to later issued commands, so not
clearing it will only cost cpu or even confuse the evaluation.

Reviewed-by: hjk
2009-11-10 13:02:33 +01:00
Oswald Buddenhagen
5976b1ba43 actively try to obtain PID of non-pthread inferiors with gdb < 7 on linux
Reviewed-by: hjk
2009-11-10 13:02:33 +01:00
Oswald Buddenhagen
23e06304f8 further cleanups in less expected shutdown paths
Reviewed-by: hjk
2009-11-10 13:02:33 +01:00
hjk
fa2a115aa3 debugger: use 'set substitute-path' 2009-11-09 16:25:54 +01:00
hjk
06570d8d7c debugger: fix display of breakpoint markers in plugins 2009-11-06 10:15:19 +01:00
Oswald Buddenhagen
e4e0cadb97 a process scheduled for kill can exit by itself as well ... 2009-11-05 16:20:47 +01:00
hjk
4ceabf26d4 debugger: fix issue where child items oeverwrite parent items in the watch model.
The real problems is somewhere in the watch model. This patch does
only prevent the wrong (and unneeded) questions to be asked in the first
place. It does not fix the wrong handling of the answer in the watch model.

Reviewed-by: Oswald Buddenhagen
2009-11-04 17:48:00 +01:00
hjk
256558d58e debugger: make switching between debuggers easier for testing purposes 2009-11-04 14:39:48 +01:00
Oswald Buddenhagen
46a7ac5fb9 fix attaching to core
InferiorUnrunnable is equivalent to InferiorStopped as far as NeedsStop
commands are concerned.

Reviewed-by: hjk
2009-11-04 10:46:58 +01:00
Oswald Buddenhagen
0ae60ba412 add timeout handling for gdb commands
sometimes, commands simply don't return ...

the debug message doesn't say anything which couldn't be found in the
log already, but that way it is more convenient.

and we kill gdb to get creator back to a defined state.

Reviewed-by: hjk
2009-11-03 18:20:43 +01:00
Friedemann Kleint
a6d099a1ea Debugger: Fix LD_PRELOAD on Mac.
Reviewed-by: hjk <qtc-committer@nokia.com>
2009-11-03 16:02:16 +01:00
Friedemann Kleint
10e07e01c7 Debugger: Use LD_PRELOAD to load debugging helper.
on UNIX. Either set the LD_PRELOAD environment variable
using a gdb command or have the TermGdbAdapter set the
variable for the debuggee. For the remote adapter,
switch on toolchain. dlopen() is a fallback for
platforms where it is not supported and attaching
to running processes. Fixes a crash with gdb 7.0
(and spurious gdb 6.8 crashes with dlopen()).
Reviewed-by: hjk <qtc-committer@nokia.com>
2009-11-03 14:06:21 +01:00
Oswald Buddenhagen
a4f2396323 fix shutdowns triggered while inferior is not stopped
Reviewed-by: hjk
2009-11-02 17:13:47 +01:00
Oswald Buddenhagen
e2d468312c flush queued commands on non-fatal continuation failures
Reviewed-By: hjk
2009-11-02 17:13:46 +01:00
Oswald Buddenhagen
bf280e215b synchronize temporary interruption with running-requests
Reviewed-by: hjk
2009-11-02 17:13:46 +01:00
Oswald Buddenhagen
e60a7bc69a the process is already dead when hitting workaround 4
Reviewed-by: hjk
2009-11-02 17:13:46 +01:00
Oswald Buddenhagen
1520963cd6 filter out expected gdb stderr
Reviewed-By: hjk
2009-11-02 10:53:16 +01:00
Oswald Buddenhagen
151b785d01 terminal adapter: make skipping of initial SIGSTOPs more reliable
first, _start being resolvable depends on libc-dbg being installed.
second, depending on the frame being in the dynloader makes it
a) work only for dynamic executables and b) fail on multi-target
systems (due to a hard-coded file name).
so instead just remember the entry point, as we are already there
anyway.

Reviewed-By: hjk
2009-10-30 17:47:51 +01:00
Oswald Buddenhagen
6d6ed26eae frames with debug info but without source cannot be navigated to
... - in the source view, that is. so grey them out in the stack view.

Reviewed-By: hjk
2009-10-30 17:47:51 +01:00
Oswald Buddenhagen
9d20a2abb4 make attaching adapters more robust
to make the behavior consistent across gdb versions, ignore the initial
*stopped which gdb7 delivers while attaching.

Reviewed-By: hjk
2009-10-30 17:47:51 +01:00
Oswald Buddenhagen
ff72733ccd fix assertions relating to stack frames without a fullname
d'oh, of course, such frames *do* exist.

Reviewed-By: hjk
2009-10-30 17:47:51 +01:00
Oswald Buddenhagen
e6be1526f1 make fullname parsing on windows less optimistic
seems like gdb 6.8 isn't any better than 6.4 wrt file name
normalization.

Reviewed-By: hjk
2009-10-30 17:47:51 +01:00
hjk
50961cb98d debugger: list registers only after we have a known target 2009-10-30 16:46:33 +01:00
hjk
d0587eaf01 debugger: workaround for contradictory gdb messages 2009-10-29 18:34:31 +01:00
Oswald Buddenhagen
e903c4d9cd reset program location when we detect "spontaneous running"
i.e., don't allow user to confuse himself :)
2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
1e96c67915 fix substituent in error message 2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
a3b52c5e03 gdb doesn't care for termination. just kill it. 2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
3edcafedcd less inefficient 2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
5e29374f87 ignore inferiorStartFailed after adapterCrashed
technically, it would be cleaner to handle that in the adapters,
but it is a lot of duplicated code without any gain.
2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
7713fc514b do not post source & module list query commands too early
if the respective view is enabled, the manager will request the
initial update in some unholy state, probably AdapterStarting -
when gdb isn't up yet.
2009-10-29 15:34:01 +01:00
Oswald Buddenhagen
0c0925b69c couple breakpoint listing with source listing
the assumption is that pending breakpoints will only be resolved when
the source list changes. consequently it is pointless to update just
one of them.
2009-10-29 15:34:00 +01:00
Oswald Buddenhagen
eee5e4b18b integrate handleStop2 into handleStop1
there seems to be no reason for delaying the display because
of -break-list
2009-10-29 15:34:00 +01:00
Oswald Buddenhagen
76b2f9f28e make sure that symgdb 6.4 "fullnames" are fully normalized 2009-10-29 15:34:00 +01:00
hjk
78be8e27de debugger: fix fetching of base class information 2009-10-28 15:40:32 +01:00
hjk
e759a3a0d6 debugger: fix dumper breakage caused by 0ee09af6 2009-10-28 14:34:51 +01:00
hjk
fc2175b2a0 debugger: fix mac startup in the presence of unknown command
Apple gdb does not give any ^done or ^error for unknown command.
Work around by using -interpreter-exec console.
2009-10-28 12:00:18 +01:00
hjk
a1da606803 debugger: better protection from infinite loops due to broken dumpers in
synchroneous mode
2009-10-28 11:50:58 +01:00
Oswald Buddenhagen
0ee09af63a eliminate handleDebuggingHelperValue1()
doesn't seem to serve any purpose at this time.
2009-10-27 20:21:59 +01:00
Oswald Buddenhagen
2fe4c0f293 call updateMarkers() from attemptBreakpointSynchronization()
and the latter is auto-tiggered by pretty much any breakpoint event.
this will kinda ensure that the markers are up-to date.
2009-10-27 20:21:59 +01:00
Oswald Buddenhagen
9b4e6512e0 protect against recursing into handleResponse
those pesky nested event loops ...

i pondered various other scenarios (in particular, the adapter or
gdb crashing while the nested loop is running), but did not discover
serious side effects of it, so i'm not trying to handle it specially.
2009-10-27 20:21:59 +01:00
Oswald Buddenhagen
3e72ecde72 fewer and better debug messages 2009-10-27 20:21:59 +01:00