Commit Graph

1303 Commits

Author SHA1 Message Date
hjk
c2bf384ac2 Debugger: Split DebuggerEncoding enum
... into a string specifying a kind of encoding (utf8, latin1),
an optional bytesize (2-byte integers, 4-byte integers) and a
flag whether the displayed value should get "..." around it.

Scales better than adding an enum value for each new combination.

Change-Id: Iffcb1e2f148f12da96e165559a976bd34026c649
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-21 07:32:14 +00:00
hjk
6a71c63186 Debugger: Make display of QObject names optional
... and switch it off by default. The feature has indeterministic
performance impact and lost quite a bit of its utility since GDB
learned to extract dynamic object types most of the times.

Change-Id: I22cccb03ba67f9ff6ad757bbc06eb372d84bbffe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-17 14:58:23 +00:00
hjk
f523f0291f Debugger: Fix editing values in GDB
This fixes a regression introduced in 3.6.0.

Change-Id: Ia87a8a60e43e99db9c214d95b8a89af15ea742fc
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-17 09:14:44 +00:00
hjk
6dcdba92f3 Debugger: Show a warning if Python < 2.7 is used
Execution will continue for now, but not for long.

Change-Id: I1abc57e6375e5ec4d24c7299f68f59c5bb06f3c9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-16 12:02:26 +00:00
Eike Ziller
ff60bf37c9 Merge remote-tracking branch 'origin/3.6'
Change-Id: I8223551aec66539dd8c55262e5000c1621410334
2015-12-15 12:21:58 +01:00
Orgad Shaneh
d4d0b889a0 Debugger: Completely ignore *running message on Windows
They appear with each newly created thread, which makes them unreliable during
startup, and useless later.

On startup, we issue -exec-continue and expect running. But unrelated *running
messages appear, and the state is changed to RunOk, although exec-continue is
not done yet. This results in "UNEXPECTED STATE" error logs.

Trust only response ^running.

Change-Id: I5e75fcd19928dab83d83ca71e9497021766460e9
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 15:41:59 +00:00
Orgad Shaneh
cbd6985693 Debugger: Consider reason-less stop on Windows as terminal sigtrap
Task-number: QTCREATORBUG-14350
Change-Id: I1d7af5f9c91cfbe43127e06d0bb7faddded4ccf6
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 15:40:56 +00:00
Orgad Shaneh
0e76b99108 Debugger: Output pending commands also on non-critical timeout
Change-Id: I964c3feb8b093b0e09b5bfc73f21897ac0335bbb
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 11:45:03 +00:00
David Fries
aba62280ae Debugger: Fix compile for g++ 4.7.2
src/plugins/debugger/gdb/gdbengine.cpp: In lambda function:
src/plugins/debugger/gdb/gdbengine.cpp:3224:30: error: the value of 'this' is not usable in a constant expression
src/plugins/debugger/gdb/gdbengine.cpp:3210:61: note: 'this' was not declared 'constexpr'
src/plugins/debugger/gdb/gdbengine.cpp:3231:13: error: 'incmd' was not declared in this scope
This reverts one code block of commit
2b16b97f19

Change-Id: Iab7f5ec84e59d9f280e0405cdd82705c14bb2064
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-03 15:19:23 +00:00
hjk
9d6c63d4d2 Debugger: Move the 'break on qFatal' implementation to gdbbridge
Easier to create invisible breakpoints there.

Task-number: QTCREATORBUG-15276
Change-Id: I76ffa45f9f0de5ffbc3b82a7ef9a4ddcdfff62eb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-05 09:42:03 +00:00
hjk
2b16b97f19 Debugger: Make DebuggerEngine::runCommand() virtual.
Allows default implementation of e.g. stack retrieval in the base
class.

Change-Id: I96460b19aa31347b2c863736b4ce2b5046eb4de6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-04 11:48:05 +00:00
hjk
601f6fd819 Debugger: Rename GdbEngine::{stackListFrames->fetchStack}
Same as LLDB now.

Change-Id: I8a59a977fe45e7f523eae59cbb4cd24b78ad8e7b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:19:05 +00:00
hjk
d5101b5d91 Debugger: Standardize on all-lowercase for protocol options
CamelCase might be more Qt-ish, but the backends tend to use
lowercase only.

Change-Id: I04b9b7305b54226f27b70151115050c4816f911f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:18:50 +00:00
hjk
b8ae9fd46d Debugger: Adjust native mixed debugging after upstream changes
Change-Id: I4d137fadd0de2aa346f2f49932faac4ee9ed41e7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-19 12:40:29 +00:00
hjk
e696b6af08 Debugger: Work around libstd++ crash
Task-number: QTCREATORBUG-15183
Change-Id: I7f0d00c984bb19f025b5e2f576017e0a982ed79a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-16 05:59:26 +00:00
hjk
01006580c1 Debugger: Go back to QVector in GdbMi
We are overstretching std::vector implementations in some
cases of partial self-assignment.

Task-number: QTCREATORBUG-15183
Change-Id: I144e9e34df117286a7eef6403e29054d530cacbe
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-16 05:59:04 +00:00
hjk
ec2e01faec Debugger: Make basic native-mixed debugging work with LLDB
Change-Id: I4d55c6a486d5adbccaa93eaa1ee461238fecfea3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-13 06:49:00 +00:00
hjk
525c33f999 Debugger: Infrastructure for reworked native mixed debugging
- Remove old experimental native mixed approach.
- Move some common stack parsing to Stackhandler.
- Mark gdbbridge.py debug output explicitly to remove it
  from actual reponse handling

New native mixed needs QtDeclarative changes and
QTC_DEBUGGER_NATIVE_MIXED=1 for now.

Change-Id: I09eed1da51cea878636d36756015b7bfaed34203
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-09 05:19:45 +00:00
Orgad Shaneh
c2b34fb1ef Debugger: Fix "Repeat Last Command" button
Broke by 150af7af4c.

flags must be stored with the command.

Change-Id: If2bac648d7d4b2c341eb6398d92b05660f519114
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-07 13:25:37 +00:00
hjk
150af7af4c Debugger: Merge GdbEngine's {run,post,flush}Command
Since we don't keep a local queue anymore, the distinction is
no more needed. Also, this is close to the LLDB side now.

Also move remaining uses of DebuggerCommand::flags to
GdbEngine, since that's the only user.

Change-Id: I61ae0f4e5294e306ab0b202e80f27fb3e3f7a7d7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-30 11:41:02 +00:00
Ulf Hermann
d5707e0e32 Debugger: Use Qt's JSON encoder for debugger protocol
The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-15 08:28:14 +00:00
hjk
7d3bb6fdee Debugger: Remove some unneeded calls to resetLocation()
Since resetLocation() is called when the repective actions are
triggered immediately before the engine's executeFoo() are called
there is no need to call them in executeFoo() again.

Also, remove the unused autoContinueInferior(); function.

Change-Id: I8d2ec419c0da6efa388ce1ed317f31d24654897f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-15 06:00:25 +00:00
hjk
7ac99044e8 Debugger: Merge watcher request creation
... of {Gdb,Lldb,Pdb}Engine. Code is the same nowadays.

Change-Id: I874b1ddfd813c15cc16c9b91bd894c7c42b56e93
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-15 06:00:14 +00:00
hjk
1cb811ebe6 Debugger: Slim down CHECK_STATE() expansion
Less generated code.

Change-Id: Iafcafc875afa3ead12e10fd5f316d9663b2f9823
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-15 05:55:29 +00:00
hjk
d15cb20ee2 Debugger: Add 'override' to *Engine classes
Thanks to clang-modernize.

Change-Id: Ie1998c32d492cb458b9b4649c425c0de272ce976
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-11 08:49:42 +00:00
hjk
3ee97ef8ab Debugger: Use the usual callback mechanism for LLDB, too
... instead of the custom mechanisms to funnel breakpoint ids, cookies
and similar through individual bridge functions.

Change-Id: I2b6e906078eefdbcd4ffa166dc1881a1d0f7fb51
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-11 07:58:02 +00:00
hjk
e37b1bdfa4 Debugger: Work around lazy GDB communication
-exec-finish in 'main' results (correctly) in something like
 40^error,msg="\"finish\" not meaningful in the outermost frame."
However, this message does not seem to get flushed before
anything else happens - i.e. "never". So force some extra output
that's known to trigger a flush.

Change-Id: I3f5ef6f7cc57dd085976b239f18d6ec7bd108972
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-02 06:44:57 +00:00
hjk
cda1f94b18 Debugger: Remove queued commands in GDB engine
Instead, always pipe them into the GDB process, even if the inferior
is not stopped. The original need to hold back commands until
the inferior is stopped seems to be long gone.

Change-Id: I234fdd067d78966c9896f1fa85a134900bf6dec7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-01 06:57:29 +00:00
hjk
afa6bb9dd8 Debugger: Make (sub-)registers editable
Change-Id: Ibca2808513b6784b65d5c7223717a8b1d930c381
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-08-28 11:04:12 +00:00
hjk
eca5ccdd3e Debugger: Debugger protocol maintenance
- Move DisplayFormat from watchhandler.h to debuggerprotocol.h
- Add/update a few comments about the use of the protocol enums
- Make decodeData take a DebuggerEncoding instead of an int

Change-Id: I50bed70a5da2e94da46e894bf9136bc14c9a1b23
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-12 12:59:41 +00:00
hjk
ac7f32e4c2 Debugger: Ignore async GDB notifications while extracting variables
Recent builds of GDB started to deliver *running and *stopped
notifications for expression evaluation, even unpaired at times.
Since we know that we are stopped when we start variable extraction
and we are stopped when it ends, the intermediate notifications
can be ignored.

Change-Id: I800082afb7df600ad4e6f97b534f4ea901c02d8a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-23 12:59:16 +00:00
hjk
e3c2236c26 Debugger: Remove guessing of register size
GDB does not report register sizes using the MI protocol, so sizes were
infered from the register name. This is fragile, better use
"maintenance print raw-registers" which reports the sizes and even
if not part of the official interface, is unlikely to change.

Change-Id: If7c7182751a496084a351aaef3a97dcdac6c500b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-22 11:40:15 +00:00
hjk
d4206752ca Debugger: Only pass environmental differences to inferior
This amends 0f46ad4a55.
Passing the whole environment is unneeded, and can cause
problems with multi-line variables.

Change-Id: I49a32c550ba52737bb8f797e227bb883be8b1df1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-07-16 13:09:58 +00:00
hjk
c81407f28d Debugger: Lift restriction one-shot breakpoints deletion
This was/is a workaround to not lose the extra information carefully
crafted one-shot-breakpoints might carry (e.g. conditions). However,
it gets into the way when simple one-shot breakpoints are used
automatically ("Jump to line", or native-mixed debugging),
so actually deleting the bp in the ui if it's gone on the debugger
side seems the lesser evil nowadays.

Change-Id: If00dc4e8f27881236c05b17109b57d7c53d424ab
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 11:52:32 +00:00
BogDan Vatra
0f46ad4a55 Debugger: Set debuggee environment vars.
Env vars should be set to debuggee not to debugger.

Change-Id: I1ff877e295cb61f3a47c3aec5ffb43dea64df1cc
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-15 08:26:58 +00:00
hjk
11d79e4f23 Debugger: Make Shift-F5 end a debugger session again
This is a regression introduced with a28ac630.

Change-Id: If870c44592de77bec10cd48b4a84fff06e788388
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-08 06:38:46 +00:00
hjk
a28ac6307f Debugger: Fix "Restart debugging session" regression
Introduced with the support for fork-follows-child.
With 'Restart', we temporarily don't have a living
thread, so that can't be taken as indication for
ending the debugging session.

Task-number: QTCREATORBUG-14393
Change-Id: I0070b9ca7e6897dab48bdbcf493d03df4709be98
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-07 13:55:39 +00:00
hjk
d48ac14fba Debugger: Simplify removal of outdated L&E items
This removes the need of bookkeeping on the engine side. It's
basically a kind of mark-and-sweep: On update begin mark items
that are expected to change as outdated, while data arrives, undo
that marking, and update end remove all remaining marked items.

Change-Id: I739b84869033d511d5c9a80605c079e87ef4f6a7
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-07 08:08:08 +00:00
hjk
60a8442d8c Debugger: Rework start parameter completion.
It's again a linear process now, with explicit entrance point for
all users.

Task-number: QTCREATORBUG-14618
Change-Id: I96c08947270ce34d7bc6c8be1d7f350dbfa14794
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-25 12:13:35 +00:00
Orgad Shaneh
e228c11a21 Debugger: Remove false soft assertion on Windows
Some libraries do not provide full names.

For example:
frame={level=\"1\",addr=\"0x2b669230\",func=\"*__GI_abort\",file=\"abort.c
\",fullname=\"\",line=\"117\",from=\"D:/sysroot/octeon17/lib32/libc.so.
6\",language=\"c\"}

Change-Id: Ibd273d451844d467395d8d7708b87f2cfc7a139e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-06-23 06:38:41 +00:00
hjk
405f2c7d88 Debugger: Remove some unused parameter
Change-Id: Ica2b6facee379fd1e046ced617e3e5176bb3d192
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-06-22 15:27:21 +00:00
Orgad Shaneh
7c33549f98 Debugger: Retrieve threads info for coredump
handleStop2 used to retrieve the stack. This is no longer right.

While at it, remove outdated comment regarding GDB version.

Task-number: QTCREATORBUG-14617
Change-Id: I9511fe5315e941fd9e08737a5b11677f9fdf8d09
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-22 14:02:21 +00:00
Orgad Shaneh
fc6480866c Debugger: Do not try to load unreadable extra dumpers file
It aborts the debugger.

Change-Id: Ia926825f658b492fa7ac738a79027186c9dd7386
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-22 05:49:41 +00:00
hjk
6cd5df7587 Debugger: Suppress warning on new GDB async messages
We don't support traces yet.

Change-Id: I4ea4db1e52111a2f7b908b925e94f63af9ce3a88
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-17 06:53:17 +00:00
hjk
d769efe1e2 Debugger: Move watchHandler()->notifyUpdateStarted() to doUpdateLocals
This was it also gets triggered when expanding tooltips.

Change-Id: I90ad39e9e82abdcd40e663b4ba4998205563009b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-06-17 06:31:53 +00:00
hjk
ad6451bbe4 Debugger: Remove the InferiorExited state
There are now several possible orders of events between sending a 'kill'
and receiving something that indicated a properly shut down inferior.
Coordinating the InferiorExited state during engine ramp down is not
worthwhile as that state had only a forced transition to InferiorShutdownOk
anyway. For the user (and user code), only the fact that ramp down is
finished is interesting.

Change-Id: Ic22131d5a1066dc62bd069f532c28b773f231088
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-17 06:26:24 +00:00
hjk
42be4ef64f Debugger: Don't quit on inferior-exited.
We might have "follow-fork-mode child" and it's only the parent exiting.
Instead quit when the last known thread is gone.

Change-Id: I77a017e6f57ae0ee383aabd2b6f0377ff8261d41
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-06-16 06:47:43 +00:00
hjk
ebb62804f3 Debugger: Compactify gdb option page creation
Change-Id: I341a84795f3e4dda67d966da9cb5476f50a680dd
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-11 10:52:53 +00:00
hjk
7c8d20ded7 Debugger: Pass request to sort struct members to {gdb,lldb}bridge.py
The request will be honored when creating the values
instead of re-sorting in the frontend.

Change-Id: I0ea13bd9b0700a4d2ae4f0b355c56ddd37557398
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-11 08:40:51 +00:00
hjk
5309e217e4 Debugger: Consolidate GDB and LLDB "updateLocals" code paths
This splits the bool setToolTipExpression() operation into
a bool canHandleToolTip(), and the actual processing of
the request, which is mostly identical to the handling of
a watcher.

Handling a watcher is now mostly the same as a full Locals
update, except for the 'partial' flag. Pushing the handling
of that down to the bridges gives identical code paths
in the gdb and lldbengine. Move that to the
DebuggerEngine base class.

Change-Id: I3861b43e8630c7e7bd57fcd549b2a2387e3d4869
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-10 07:40:27 +00:00