Commit Graph

482 Commits

Author SHA1 Message Date
David Schulz
48850dfa4d Debugger: add callback for interrupt inferior
This allows to run any command without knowing the current state of the
debugger engine. Replacing the old special stop mode for any command
that may be triggered while the engine is running, with a check in
runCommand. If the engine is running while a command is triggered a
callback is added to the interrupt that will execute the command as soon
as the engine is accessible again.

Change-Id: I8bb1914b92da2b03e76c2c2ec8293d13041c72fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-23 13:17:47 +00:00
Christian Stenger
9ecb0c75a1 Debugger: Fix warnings for MSVC
This patch amends ef952d6caa.

Change-Id: If8809cf2985a4528eeff31263be4240b7e63a8b7
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-07-23 11:46:05 +00:00
David Schulz
ef952d6caa Debugger: modernize cdbengine
Change-Id: Ifac1bceb2d5d485269a44c4e3e6def403e6d7b20
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-06 09:10:31 +00:00
hjk
0fbb2839f9 Remove ApplicationLauncher::Mode
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-05 15:08:29 +00:00
hjk
4feb2259d9 Debugger: Code cosmetics
Sprinkling in const and ranged for.

Change-Id: I5d11d57f64140021397c23734c7373544ebebb6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 07:10:47 +00:00
hjk
8416a14f3d Debugger: Simplify use of getUninitializedVariables()
Change-Id: I7962fe2d582fc3f2ad6a76fb600038f454b75dc0
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-28 07:36:42 +00:00
hjk
94d41afade Debugger: Move cpp snapshot storage to cdbengine
It's the only one using it.

Change-Id: I95dc4918c82653710a47cb8d0043bb3241e954ac
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-28 07:36:32 +00:00
hjk
1b87d19a64 Debugger: Modernize
Mostly nullptr instead of 0, but also a few bits of collateral damage.

Change-Id: I921991272aca921dcdecf302dfff3716e79dfc24
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 10:28:54 +00:00
David Schulz
01bc302c48 Debugger: Do not add CrtDbgReport breakpoints for vc19
The symbol isn't safely resolvable and can lead to unwanted breaks.

Task-number: QTCREATORBUG-19628
Change-Id: Iaa58b12cb826a9e20faa64454e806ecab9d613f3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-23 13:08:25 +00:00
David Schulz
f33ef0e80b Debugger: automatically add source path mapping for Qt packages
Change-Id: I1199629729e3996adb574089c5db69f1fcf0ccd0
Reviewed-by: hjk <hjk@qt.io>
2018-01-15 13:53:01 +00:00
Robert Loehning
e07bf2f682 Make missing uses of IDE name configurable
Change-Id: Ie89293b80adfacea19bcb949e4524f16fbb223f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-03 10:26:24 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
hjk
83c13ff191 Debugger: Combine the InferiorShutdown{Ok,Failed} states
... into a InferiorShutdownFinished.

Change-Id: Icb5394f38f52f7cf300dc83f4eb8f2f0777bbcba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 11:26:52 +00:00
hjk
585b2c62d5 Debugger: Combine the EngineShutdown{Ok,Failed} states
... into a EngineShutdownFinished. They were never handled differently,
and the only option is to proceed to DebuggerFinished anyway. So
simplify the state machine a bit.

Change-Id: Ied3be86fff6750abca578dc6788e4be1d895692b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:42:44 +00:00
David Schulz
800aa7466f Debugger: improve symbol lookup times for cdb
Task-number: QTCREATORBUG-18613
Change-Id: If8dac096fa4d0d8afc6fb8f7bbffd090a5dc6e19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 13:59:01 +00:00
hjk
8f1a161c64 Debugger: Merge EngineSetup and InferiorSetup start phases
It was needed in the past to trigger e.g. gdbserver setup in
remote cases which is nowadays handled by separate RunWorkers.

Change-Id: I30bce071dab0779cce2e7abef7b31550d8539461
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-06 13:30:04 +00:00
David Schulz
d2784c6805 Debugger: Set inferior device when attaching to running application
The device is needed to properly interrupt the inferior with cdb.

Change-Id: I96f3a7393770be9821d8edd7123c458399d4494a
Task-nnumber: QTCREATORBUG-19253
Reviewed-by: hjk <hjk@qt.io>
2017-11-13 11:25:42 +00:00
Orgad Shaneh
175afabbd7 Cdb: Do not crash if no device is set
It still fails with a soft assertion, but at least doesn't crash.

Task-number: QTCREATORBUG-19160
Change-Id: I3779f64e752abf9d3779219552a4a1be648f1dea
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-25 13:27:19 +00:00
David Schulz
b248953247 Debugger: Fix attaching to running process with cdb
Do not add inferior command line arguments to the cdb process if we are
attaching to an already running process.

Task-number: QTCREATORBUG-19034
Change-Id: I7b9a98b790e819fc76ff4ec75769785741bfde83
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-17 07:55:24 +00:00
hjk
d3c1dfe45a Debugger: Consolidate CdbEngine::startEngine()
Change-Id: I92c74b96c891bb46b7ceb9c45ffea268a223b325
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-13 12:32:20 +00:00
hjk
1a1c9bf828 Debugger: Use shared TerminalRunner also for CDB
Change-Id: I2dd9b16f5699d0551a2de3e8ebefc865b98ad862
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-13 12:31:31 +00:00
hjk
82e0eefc8d Debugger: Move static type related code to CdbEngine constructor
Change-Id: I5d5489030eab9c16385df9af15f5974eaa2190e0
Reviewed-by: hjk <hjk@qt.io>
2017-10-05 09:02:32 +00:00
hjk
d0e419e02b Debugger: Move some CdbEngine member initialization
More concise.

Change-Id: I28ac441cacfceef1ad5622f15fecac1d2cca9395
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-05 08:20:41 +00:00
Robert Loehning
444e4f7ee6 Debugger: Initialize CdbEngine::m_autoBreakPointCorrection
Change-Id: I5baf137116e71d39c23dcc7bc12e87b363f30d98
Reviewed-by: hjk <hjk@qt.io>
2017-10-04 18:52:25 +00:00
hjk
af63f488c2 Debugger: Simplify CdbEngine construction
Moving the knowledge that this won't work well outside windows
kind of decreases encapsulation, but that's not really worth the
complication of the error handling here.

Change-Id: Idcb6f6d64f33ee8c49a01e62e20aad16d3f01b86
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-29 14:12:54 +00:00
hjk
895acd23e3 Debugger: Move external terminal into separate RunWorker
Change-Id: Ifb9701f840195ba90db48a0f6fa07b28e0409648
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-27 12:16:19 +00:00
hjk
526e217ce9 Debugger: Centralize abort handling
... and apply even more force on the second trying by forcing
ramp down of the runControl itself instead of hoping that it
would pick up hints.

Change-Id: I9d0f4130cb9a137b91c9fa81c3d255f236f98be0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-21 12:46:13 +00:00
Jarek Kobus
b506fce0fe Fix string messages
Found during translating.

Change-Id: I9626b3393d7b53300f7c806acbc5e12bc58574d2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-11 08:29:41 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
hjk
a512c8e0c8 Debugger: Centralize some parameter sanitization
Change-Id: I00e7c22adcf32ba8251b357e75eb9207b6f98f1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-06 09:57:27 +00:00
Joerg Bornemann
d954c944fe Fix application output of qtestlib projects when debugging with CDB
Tell QTestLib to use OutputDebugString for logging when "Run in
Terminal" is turned off. This way we are able to distinguish CDB's
output from the debuggee's output.

Task-number: QTCREATORBUG-16161
Change-Id: Ie5e6e4a0cbb853167766f782521101eff2e1963a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-29 07:27:50 +00:00
Orgad Shaneh
9a1030cfab CDB: Fix loading of user scripts
Change-Id: I20008227fd73b16978d63b50c4b9a38c0b590f09
Reviewed-by: hjk <hjk@qt.io>
2017-08-27 13:07:31 +00:00
Leena Miettinen
6fccc45a92 Debugger: Fix UI text to follow the guidelines
Change-Id: I7afa680c15f9dacfa8b0a17c16c442211d4fc7ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-08-01 11:15:04 +00:00
hjk
406ddaa36c Debugger: Remove DebuggerRunParameters::device member
The device is always available via runTool().

Change-Id: I4a2a791a5a75b32803c06fc34947b82b869fe31c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-01 13:49:17 +00:00
hjk
36ec37b29d Debugger: Streamline ramping down
There were only two used target states, and in case of mixed
debugging all parts of the machinery better agree on the
direction. So one bool in the (shared) runTool is sufficient.

Change-Id: Iffbf1651b82dde707cfc37d8da9d3da573b34b76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-19 09:56:49 +00:00
David Schulz
f811cff769 Debugger: Execute extra dumper commands after cdb start
Change-Id: I3dfc803695ffaa04d719103d8bec59ce8b4f08e5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-05-18 13:07:52 +00:00
hjk
1f6764a54e Debugger: Move run parameters from engine to tool runner
The parameters belong to the run control, they should not
be triplicated in case of a combined engine.

Change-Id: I4dd84220edbd7a44b902cc52627fe01d0568db75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-18 07:05:09 +00:00
Eike Ziller
6e8ee7479e Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/debugger/cdb/cdbengine.cpp

Change-Id: Ib9aeccc4162c43e9ee3d85847d96678045625dd0
2017-05-09 15:07:30 +02:00
David Schulz
a4bc6e8ee6 Debugger: Instruct user to enable CDB support component
If the cdbextension can't be found in 4.3 it's most probably caused by
an update of Qt Creator via Maintenance Tool. Instruct the user to
enable the 'Qt Creator CDB Debugger Support' component via the missing
cdbbextension message box.

Change-Id: I1e71d89ca75049dc1a2aacbe2b17bebf910a0d91
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-08 06:55:46 +00:00
David Schulz
c3191f5922 Debugger: Adjust missing cdbextension message
The cdbextension isn't part of the binary artifacts repository anymore.
Adjust the message so the user knows that he has to build the
cdbextension in the matching bitness by himself.

Change-Id: I5a06edda62be8178fc64fb98468291d395598d74
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-02 09:10:09 +00:00
Eike Ziller
dae2556d2f Merge remote-tracking branch 'origin/4.3'
Change-Id: I44511e06986b7df6007be7daf7051c895a10794b
2017-04-21 15:30:00 +02:00
David Schulz
7fa9316a96 Debugger: Disable break on warning/fatal for cdb
This seems to cause more trouble than benefit. Additionally this option
is on the _gdb_ extended settings site.

Task-number: QTCREATORBUG-17902
Change-Id: Ie548f68f84bffee670559b48f6a2ba259f8b8757
Reviewed-by: hjk <hjk@qt.io>
2017-04-20 08:00:21 +00:00
David Schulz
e19620ddd5 Debugger: Warn about unsupported shell commands when using cdb
Task-number: QTCREATORBUG-6927
Change-Id: I20e2311d5069da9315a7b5a5bc8d698fe5e6e52b
Reviewed-by: hjk <hjk@qt.io>
2017-04-19 09:05:16 +00:00
Montel Laurent
d29396b164 Use qEnvironmentVariableIsEmpty or qEnvironmentVariableIsSet directly
Change-Id: I4f2e61e4bade9e7b4518d144db8163e596ab6264
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-04-19 08:00:14 +00:00
David Schulz
17485c0678 Debugger: Optimize python output handling
Change-Id: Ia97e8adaabbffe49acec44575621a4f4243c5cea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 07:07:38 +00:00
David Schulz
c00bb1dcfb Debugger: Pass uninitialized variables to the python dumpers
Reduces accessing uninitialized memory

Change-Id: I025e9070b9b17a806237619b484cb27230e7f494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 07:03:23 +00:00
David Schulz
68ac850fe6 Debugger: Fix command setting active frame
Using this command without prefix and with the 0n decimal prefix
resulted in unreliable frame selection. Last chance is the hexadecimal
prefix.

Change-Id: I935d88849eb541534d4f311ac6059bcd35aee62c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-29 12:39:25 +00:00
David Schulz
c73bcd32a8 Debugger: Prepend additional info to cdb exception task entry
Most users expect build related entries in the Issues pane, so prepend
debugger related exception entries with a prefix making clear that these
entries are not build related.

Task-number: QTCREATORBUG-17806
Change-Id: I8a78c1eff3a4386f108997954329b694c223400f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-27 07:58:15 +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
4e1922ce5f Debugger: Remove some unneeded "No process" notification in CDB
Change-Id: I84d4aa30ff52f9a368503edc41f4a51e709a3a6e
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-01 08:37:03 +00:00