Commit Graph

1265 Commits

Author SHA1 Message Date
hjk
e9b1e493c2 Debugger: Move struct sorting logic to generic parser
Backends only have to specify whether an object members are sortable
in principle (e.g. all structs), and some numeric 'sortgroup' value
for member items (higher values are always sorted on top).

Change-Id: I10ce94580374fed48a35f058a575a1408d6801af
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-08 10:22:31 +00:00
hjk
6ed9ac35be Debugger: Do not change LANG when starting GDB
LC_NUMERIC is enough for the float reporting problem, and
LANG is too intrusive

Task-number: QTCREATORBUG-16010
Task-number: QTCREATORBUG-16024
Task-number: QTCREATORBUG-12800
Change-Id: Ia5bc31152e2b137c6b830a232460542a3827138a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-04-07 09:51:58 +00:00
hjk
bb516e49ae Debugger: Escape quotes in GDB breakpoint conditions
Task-number: QTCREATORBUG-15821
Change-Id: I81faf3d31598538c04f843694b04f938bfb61a6e
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-07 09:03:06 +00:00
hjk
35a16cc394 Debugger: Make some of the plugin tests compilable again
Change-Id: I5c3885cb385dc1c15dce14f2ff52bf70edee8399
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-16 14:04:05 +00:00
hjk
af8d9b1dc7 Debugger: Adapt to Android(?) GDB 7.10's changed register format
The previous 'v4_int32' tag now shows as 'u32'. Look for either.

Change-Id: Ie47fd564ec5ee1f08f44f3fb43180f5cdc495884
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-03-15 12:06:47 +00:00
hjk
c09ebb8f13 Debugger: Re-enable retrieval of register content
Less use of magical object names.

Change-Id: I2da17f1cefe1a72f4ea8be4c041e7443265def93
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-15 08:47:21 +00:00
hjk
2cf0060596 Debugger: Use StandardRunnable in DebuggerStartParameters
This is a mechanical replacement for the former executable, processArgs,
inferiorEnvironment and workingDirectory members.

Change-Id: I4160e01427ed801df9b729f1f31d0a2ca48159b5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-28 14:15:54 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Andre Hartmann
2a59bd6514 Gdb: Use 'C' format for variable printing
On Linux systems, GDB may produce localized output of
float/double variables, which inhibits changing the
display format in Creator.

Task-number: QTCREATORBUG-12800
Change-Id: Ic042979c78319ff029f08a8766c8719c46052374
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-05 10:46:03 +00:00
Oswald Buddenhagen
5a7d3e78db Merge remote-tracking branch 'origin/3.6'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: Ifbe181e86c161e082cc9a69a4bc7bd399f34ff47
2016-01-04 14:11:07 +01:00
hjk
8e702387e5 Debugger: Start separating different process environments
Debugger and stub run locally, the debugged process not necessarily.

Change-Id: Ibf6aec3dcaec60069866ec0765ec2178ca0a26d6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-04 12:33:47 +00:00
Andre Hartmann
067682a25e GdbEngine: Fix typo
Change-Id: I333cee6370202ed5e9623025d484a2f5637a05c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-22 09:38:57 +00:00
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