Commit Graph

240 Commits

Author SHA1 Message Date
David Schulz
890e7546e4 Debugger: Merge prepareCommand
Change-Id: Idd316a88ae39d563c99d3b4081f88fc41e604499
Reviewed-by: hjk <hjk@qt.io>
2017-04-19 09:05:09 +00:00
hjk
329db5f4cc Debugger: Use ProcessHandle in notifyInferiorPid()
Change-Id: Idcb6819b64964b6aa0e72d182cc628feba37ba55
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-01 11:57:48 +00:00
hjk
32ae4d3e09 Debugger: Use Utils::ProcessHandle for DebuggerEngine::m_inferiorPid
That's the intended "typesafe" use.

Change-Id: Ib288fe87a47bd9484bda83e05406f0d22989b3c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-01 07:56:18 +00:00
hjk
66b19f334d Debugger: Provide a startup customization hook for 3rd party plugins
Change-Id: Ia587abcb1bdcdfbf192d3314610ec9addf370c9b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-23 14:48:28 +00:00
Eike Ziller
b1e2d5b693 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ib3073a0a3d80c99cf97b9839480dbf9583fa10de
2017-01-23 13:13:14 +01:00
Filipe Azevedo
178430dcd1 Fix inferior pid not being propagated
Change-Id: I373621f78bae04f7cdcc66fcf84712acb4245014
Reviewed-by: hjk <hjk@qt.io>
2017-01-18 12:17:43 +00:00
hjk
fc01d0ac46 Debugger: Use new shared result reporting infrastructure
Unify the watchPoint() interfaces, move the combined
implementation to the DebuggerEngine base.

Change-Id: Ic93aa760e7258197aed5eb7bfea257a40012cccf
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 07:41:43 +00:00
hjk
a61b6dfc57 Debugger: Move command flags to debugger command
Also, remove the need to mark GDB Python commands, detect the
need to use MI on the presence of non-Pythonic letters in
the command (space and hyphen).

Plan is to reuse even more almost shared code between engines.

Change-Id: I4e00debb07f2482637930675a28f464666b59553
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 07:41:17 +00:00
hjk
c2eada278e Debugger: Fix Window grabbing on GDB
Needs to make namespace detection work without valid frame

Task-number: QTCREATORBUG-17326
Change-Id: Ia7c7017db4ef384d4f246e11a5601d01f4f366f1
Reviewed-by: hjk <hjk@qt.io>
2016-12-15 17:22:18 +00:00
hjk
b99cb464fa Debugger: Add convenience function to pass lists of strings
... to *bridge.py and adjust surrounding code.

Change-Id: I398ecf10a6b9c76ebf5683d2f3a6c28b57343663
Reviewed-by: hjk <hjk@qt.io>
2016-12-15 16:53:24 +00:00
hjk
f1a05dfb35 Debugger: Suppress putting full environment contents into logs
People are known to put things like passwords into environment
variables, and we pass the environment hexencoded to the debugged
process, so it might be overlooked when logs passed around.
Better not have the data in the log to start with.

Change-Id: If93a42a291b8b62c38d01e606cc0e49b8f2e3e95
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-07 07:40:33 +00:00
hjk
d98d9025b8 Debugger: Fix environment passing with LLDB
Change-Id: Ic51a5ee1b9ef69b60279f045175be6d59b53582b
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-07 07:39:44 +00:00
hjk
bf639fbcc6 Debugger: Do not attempt to update registers when not stopped
Task-number: QTCREATORBUG-17340
Change-Id: I582aa0bcbb41e62d34167c62bfc0cff6e6040b7b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-25 09:26:36 +00:00
Ulf Hermann
d771ba8921 Debugger: Don't clear unrelated views when updating locals
If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 09:35:10 +00:00
hjk
13652036ff Debugger: Expand Creator %{...} macros in LLDB startup commands
Bring it on par with GDB.

Change-Id: I38fb6dbac226e7a3c57d11496ff8c0d76bf44823
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2016-09-26 14:58:16 +00:00
hjk
851619e2d2 Debugger: Force a newline after sending LLDB startup commands
Change-Id: I2d190b4681d912cd255c2a9463fff2adc994cfc0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2016-09-26 14:58:10 +00:00
hjk
bf5f96e423 Debugger: Fix passing working directory with LLDB
It's not the one of the lldb process anymore, so set it explicitly.

Change-Id: Ibcc2b63631c4096f860996ad6ccfc12415d8aefd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2016-09-26 11:57:36 +00:00
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03:00
hjk
b8f96f5629 Debugger: Make {G,Ll}dbEngine::doUpdateLocals more similar
Change-Id: I8877dbc3b6c9166d8d8781453b753f22ebc0a579
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 13:37:19 +00:00
Vikas Pachdha
1787d00e6e Continue process after lldb attach
lldb stops the process after attaching and the event loop is not yet started.
This makes the debugger wait for events while process is in stopped state

Task-number: QTCREATORBUG-15705
Change-Id: Iae6fe94fc483d963b377582c4cbbb443be5e6cba
Reviewed-by: hjk <hjk@qt.io>
2016-09-14 14:17:40 +00:00
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