Commit Graph

220 Commits

Author SHA1 Message Date
Orgad Shaneh
d407dfac65 Debugger: Replace macro usages with HostOsInfo
Change-Id: I6c42e20d7ef5596577a8b13737aba64b7783b7bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-13 05:38:47 +00:00
Orgad Shaneh
5bc8d10baa Remove uses of deprecated QProcess::error signal
This overload of error is deprecated in 5.6.

Replace with errorOccurred, which was introduced in 5.6.

Change-Id: Iccfba7e7103b7ce377471696f1f2ec217e52c840
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-09 16:02:43 +00:00
hjk
588443b259 Debugger: Use a StandardRunnable for the debugger process
One step further to separate the debugger environment from the
inferior environment and to make it possible to configure a
working directory. Guessing one from the inferior's working
directory is not always a good idea.

Change-Id: I33d139c0f228ec0870556b82bc6aecca0a8e62d6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-04 10:07:43 +00:00
hjk
6e925910b4 Debugger/BinEditor: Standardize interface
Change-Id: I4acf6bc7648e57c564e86023176ae3905a293a99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-21 06:20:52 +00:00
Leena Miettinen
306e253485 LLDB: Fix punctuation of a message
Change-Id: I39812410ca6117c7f3b7ea8d2a33d3ec5bf490c0
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-21 14:28:43 +00:00
Erik Verbruggen
ae7e03d51f Fix compilation.
There is no + operator that takes a QByteArray and a QString (or vice
versa).

Change-Id: I8734923cbbb0360bc20f9775d57801803782716f
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-09 09:47:15 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
hjk
b001122900 Debugger: Do not abort LldbEngine too eagerly
Not all untimely requests to run a command are harmful,
e.g. reloadModules() can be triggered by visibility
changes of the modules view at any time.

Change-Id: Ie803135ff7b954eef5800b3becdc6104a61b8cb2
Task-number: QTCREATORBUG-16393
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-07 14:08:58 +00:00
Eike Ziller
73bb92c5a6 Merge remote-tracking branch 'origin/4.0'
Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
2016-05-31 12:02:13 +02:00
hjk
8ddce2fbd4 Debugger: Disable Run in Terminal with LLDB globally
This forcefully ignores the Run in Terminal setting, i.e. debugger
starts up properly, but without the console. It a stop-gap measure
deemed less harmful than the 4.0 'start up gets stuck' behavior.

Change-Id: I015147c4db23bf91ea09001ce923fbab97eeae77
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-30 14:07:25 +00:00
hjk
3a6ee2c305 Debugger: Move console stub procedure creation
... to a place where it can potentially be re-started.

Change-Id: Icc7ba4512533cdef659507442eec069e073f84b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-30 14:07:17 +00:00
David Schulz
595cc6e310 LLDB: Quote environment variable assignment.
Change-Id: Ie93d251ba120fd33ab3ab12e243ff1e1818ba46b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-11 11:58:48 +00:00
hjk
2e38eec002 Debugger: Compile fix
stringSettings() macro-expands internally nowadays.

Change-Id: Id702ee852b7c25b8ff7dbca0c6ada529a53a9443
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-15 14:47:34 +00:00
hjk
4ba5dfccf5 Debugger: Make LLDB startup user-configurable
... by reusing GDB startup command settings

Task-number: QTCREATORBUG-15584
Change-Id: I24a04ac8608f0c37374ff9c1d93d509a811d8942
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-15 11:19:23 +00:00
hjk
c0fabbe169 Debugger: Add breakpoint commands for LLDB backend
Commands needs to be given in Python, i.e. something like

    import time
    print time.asctime()
    for i in range(1, 10):
         print(i)

works.

Task-number: QTCREATORBUG-15585
Change-Id: I7724617e4bbe85a717ae78b21014e2b55c4089c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-15 10:50:45 +00:00
hjk
d2f8213728 Debugger: Fix reporting of special dumper formats for LLDB
E.g. for QImage etc.

Change-Id: I78201f55448a151d40d0d7fb10440a6cb87efd03
Task-number: QTCREATORBUG-10402
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-14 14:40:46 +00:00
hjk
9425f28865 Debugger: Hex-Encode LLDB disassembler comment fields
They may contain quotes and possibly other data breaking the transport
protocol.

Change-Id: I53795bd1de54385e8d9c50088368fdc768db217b
Task-number: QTCREATORBUG-15635
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-14 12:49:59 +00:00
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
385b0d1218 Debugger: Update breakpoint pending state with LLDB properly
A breakpoint with known locations is not pending.

Change-Id: I4da7b60b6771bbea40ce74d44518c26e6214ba6c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-04-07 08:28:23 +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
Eike Ziller
f4e87a7e0c Merge remote-tracking branch 'origin/3.6' into 4.0
Conflicts:
	src/plugins/projectexplorer/applicationlauncher.cpp
	src/plugins/projectexplorer/applicationlauncher.h
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilertool.cpp
	src/plugins/qtsupport/uicodemodelsupport.cpp
	src/plugins/qtsupport/uicodemodelsupport.h

Change-Id: I6f6ae77422d99f4f422b108ade6b64273df9dd57
2016-03-03 16:10:04 +01:00
Alexandru Croitor
357e7ee965 Debugger: Fix switching between threads not updating stack pane.
Task-number: QTCREATORBUG-15587
Change-Id: I41b2025e26d79ca0acf12d8d6468786f5dd121b2
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-02-24 16:32:17 +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
hjk
11e9e0e330 Debugger: Fix magic dumper debugging aid for LLDB
Change-Id: I665e6bc7b8898d09043cb0b73cabdb98f55668eb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-05 12:46:00 +00: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
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
58bec40246 Debugger: Force passing DYLD_.... environment variables to inferior
Apple's LLDB has changed behavior between 330.x and 340.x.

Newer versions seem to actively delete the DYLD_IMAGE_SUFFIX,
DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH environment variables
from the scripting environment.

Change-Id: I0b7bbdce0975e969b1dae5770fd9a99328f241be
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-12-08 16:29:17 +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
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
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
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
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
2930754acf Debugger: Fix LLDB dumper result reading on Windows
Change-Id: Ic9b71a5fac0b04735851adfb91117b9dc8bd8462
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-04 09:27:36 +00:00
hjk
5829b22b03 Debugger: Also show instruction bytes in LLDB disassembler
Change-Id: I9676e458153b745fc75a5da271524e73959fba03
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-31 11:51:19 +00:00
hjk
d16aed4304 Debugger: Add display of mixed disassembler output for LLDB
Change-Id: I4997ce4fb4ce6a61cca67e36abb84c61a1c120f5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-28 13:44:49 +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
2d30693450 Debugger: Fix LLDB extra dumper passing
Change-Id: I1601a894b8adb3365894b21e06d4929e381b7a01
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-07-17 09:38:33 +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
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
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
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
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
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
hjk
9af735e2ae Debugger: Use QtcProcess instead of QProcess for LLDB
More similar to what GDB does.

Change-Id: I2c5e952261119f04a515f8b8e79a66c397bff6df
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-08 06:09:28 +00:00