Commit Graph

1491 Commits

Author SHA1 Message Date
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
Eike Ziller
3d9cf954e2 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/debugger/gdb/remotegdbserveradapter.cpp

Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
2017-09-19 12:10:26 +02:00
hjk
7eec0f63ac Debugger: Merge DebuggerStartParameter into *RunParameters
The users (typically target specific DebuggerRunTool derived classes)
are meant to use the individual setter functions nowadays, not the set
up the full structure, so the members are a true implementation
detail now.

Change-Id: Ida04801e3230a2fe8bbadde8845e58c3077c87a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 14:00:59 +00:00
hjk
ac2012a73a Debugger: De-virtualize *Engine::notify* functions
Most were never re-implemented, so just for debugging purposes
in the mixed engine.

Change-Id: If569e0e553e3fdd5ef83b3bdfdbd22fd0ad5b90f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 06:12:03 +00:00
hjk
f84d44e4e8 Debugger: Merge *Adapter classes into GdbEngine
The main reason for having the adapters (complex target specific state
handling) is mostly gone now, leaving us mainly with the drawbacks
of the solution: An additional indirection, and using a hierarchy
for code sharing. So drop that, and use if/else chains instead
of virtual functions now, and start simplifying the result.

Change-Id: Idcf3a28da103c01cfa80cf9bab8ef51fe879b6d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-12 07:01:59 +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
hjk
440f2ba028 Debugger: Dissolve a few more setRunParameter() cases
Change-Id: I92d7b75c9a9758ab8c2ad8f9956ebcd8ecc9cb69
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 13:42:18 +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
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
hjk
cf1edc1fb5 Debugger: Restrict scope of stored signalOperation
It's only actively alive between the attempt to stop, and being
stopped. Having it stored in 'global' member variable was a
workaround in pre-lambda times.

Change-Id: I169745afd7985ed9038edff763026c32f82f6126
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-17 10:04:34 +00:00
hjk
ef1b0f999d Debugger: Fix assert handling for devices without signalOperation()
That's not a full solution, but fixes the reported crash.

The core of the problem is that BareMetal devices do not provide
signalOperation() (which is ok) and this code path should not have
been taken to start with.

Change-Id: Ib903b8d7f0728c5b3cb217b567247e66b751c5c3
Task-number: QTCREATORBUG-18694
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-17 09:01:20 +00:00
Christian Stenger
d68f258754 Debugger: Avoid crash when attach to process fails
If attaching to the current's project running executable fails due
crashing inferior the run tool is cleaned up already when trying to
fetch its run parameters.
Circumvent by checking whether run tool is still accessible.

Change-Id: I56f3d841d77d0513806a2b91357841f160f74ed3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-07-27 05:02:59 +00:00
hjk
acc86aee5a ProjectExplorer: Move re-runnable decision to RunWorkers
A RunControl is re-runnable if all its workers are,
a RunWorker is re-runnable if it's Stopped and unless it
says otherwise.

Also ensure SimpleTargetRunner only reportStop() once
per run and make process error message re-usable.

Change-Id: I73f5fb724d3026ceb81d5e32a3a71b4814b2bca9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-10 09:02:17 +00:00
Orgad Shaneh
4832f75d53 Debugger: Avoid soft assertions in register list values
Change-Id: Ia5444b935c964fd450bed67306dc10ed9d54e7c7
Reviewed-by: hjk <hjk@qt.io>
2017-07-10 07:35:11 +00:00
Alexander Drozdov
c346183768 GDB: fix information text truncation in Application Output pane
GdbEngine::handleResponse() incorrectly handles messages starts
with '@'. Seems that text position pointer by `from` and `to`
vars already correctly configured and additional cutting with
QString::mid() is not required.

Seems issue was introduced by 726b907cc3.

Change-Id: I2759d1c1650a1949c9c9feb75cf12e2760920d21
Task-number: QTCREATORBUG-18494
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
2017-07-03 07:52:07 +00:00
Friedemann Kleint
eadd033fb9 EnvironmentItem: Introduce operation enumeration
Extend operations to handle prepend/append which can be optionally
determined by diff(). This allows cleanly implementing
the MSVC toolchain setup.

Amends c7a84634fd

Change-Id: Ida08d8f5e00cf5f78c20ea8d08c531b1ed22c015
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-26 06:40:50 +00:00
Orgad Shaneh
a33bf92bd2 GDB: Set OsAbi also when the executable is ELF and the toolchain is not
If the toolchain is misconfigured, it's still possible to save GDB from
crashing by reading the binary format from the executable.

Change-Id: I8f8db163e1dd6aef31fed23b1306e714e563646a
Reviewed-by: hjk <hjk@qt.io>
2017-06-21 09:13:21 +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
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
hjk
6e990f96c6 Debugger: Remove DebuggerRunControl
Use plain RunControl + DebuggerRunTool combo instead.

Change-Id: Ib71b5eab50da667b9d71dcc6689d2643ad8ecdee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-28 12:42:29 +00:00
Eike Ziller
56233f67e1 Merge remote-tracking branch 'origin/4.3'
Change-Id: I01d7d8aa282f2bca94f85f55c832c76672e229f7
2017-04-25 16:15:04 +02:00
hjk
fa6caa3b02 Debugger: Use proper placeholder in error message
Task-number: QTCREATORBUG-18078
Change-Id: I48cd8c24ca1236c69150f0d93b525a5a85447fff
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-25 09:51:48 +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
890e7546e4 Debugger: Merge prepareCommand
Change-Id: Idd316a88ae39d563c99d3b4081f88fc41e604499
Reviewed-by: hjk <hjk@qt.io>
2017-04-19 09:05:09 +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
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
hjk
5d97c4871a ProjectExplorer: Remove startRunControl()'s runMode parameter
It is redundant, as a RunControl has a runMode() getter.

Change-Id: Ia048b271a5003356d21f86a3f778827d23466037
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-12 12:11:49 +00:00
hjk
ee27248a56 Debugger: Streamline DebuggerRun{Control,Tool}Setup
Only one code path needed once we have a RunConfiguration.

Change-Id: Ib65f471a929a0c70694dd142b4f83be7eebbe151
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-12 11:56:44 +00:00
Orgad Shaneh
b66baab4b7 Debugger: Run user commands as native commands
Change-Id: I2b13880eace49818c20815a21c3e327f87ec04bc
Reviewed-by: hjk <hjk@qt.io>
2017-04-05 05:49:10 +00:00
Orgad Shaneh
1bc2610b0b GDB: Fix break on main for console applications on Windows
It relies on the user setting (which has a correct default, but can be
changed), but that's better than nothing.

Change-Id: Ib74b348a8932b3522074f122cf939fcb20ccefb8
Reviewed-by: hjk <hjk@qt.io>
2017-04-04 14:36:44 +00:00
Robert Loehning
8e1910b7cd Debugger: Comment out dead code
Change-Id: I91218d9b7b3fa6433d7e64d68b4974a1fdcd295c
Reviewed-by: hjk <hjk@qt.io>
2017-03-07 17:31:33 +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
99a6d78bba Debugger: Use (only) -thread-group-started as pid notification
The notification exists since GDB 7.4, i.e. no further restriction beyond
our current 7.4.1 minimum requirement, so there's no need to read pids
from tea leaves.

Change-Id: Ibfe14a46059fc1c917ada6ac445b364c958d0b3f
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-28 10:19:11 +00:00
hjk
9c211ab424 Debugger: Record breakpoint hit count
Looks like the field was spelt 'times', not 'hitcount'.

Change-Id: I7226747ba7d41e9600cb66e95e7c59c6a226151b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-21 11:44:05 +00:00
hjk
e051c9c28b Debugger: Trim user startup command input before usage
No need to push empty lines etc.

Change-Id: I16862e9cc1fe19ced1000a954c71a4044ed9d0ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-15 09:27:31 +00:00
hjk
541dd8643d Debugger: Inline GdbEngine::write into caller
Not used in earnest since the end of CODA/Symbian.

Change-Id: Ib2d22fb247d178b091a17f9927aa911d6707d3f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-07 06:58:03 +00:00
hjk
fd2bf97f82 Debugger: Remove the "Attempt quick start option"
This was GDB-only. It complicates the startup mechanism including breaking
certain setups (e.g. users manually controlling "set auto-solib-add" in
their .gdbinit) without providing too much benefit (anymore).

Part of the potential debugger startup time improvements that were
possibly gained by the feature are nowadays available by using a
release build *without* debug info, as one of the original reasons
to not use that (making Qt type introspection hard/impossible)
is largely gone with 4.2+.

Change-Id: Iffb34e0035f39ad74b24bf025749b546f25a489b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-06 13:15:19 +00:00
hjk
b8c0801e0a Debugger: Run extra post-attach commands as "native" gdb commands
Change-Id: I5c3fac1e03b400f837a090b136ff8aa0ce8e21de
Task-number: QTCREATORBUG-17659
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-01 08:10:54 +00:00
hjk
a17919fbd0 Debugger: Allow explicitly marking of non-Python commands again
This conceptually reverts part of a61b6dfc.

Task-number: QTCREATORBUG-17594
Change-Id: I9ff72a027838a20039f217ed0d669b6c45bc2acf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-24 10:46:47 +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
Tobias Hunger
c6f90e575e Utils: Introduce a TemporaryDirectory and TemporaryFile class
Both wrap the corresponding Qt class, but make sure all temporary files
or directories are created inside a "master temporary directory".

Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-20 12:17:10 +00:00
Eike Ziller
589fedf455 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/projectexplorer/kitinformation.cpp

Change-Id: I94299b069418586db97d1d596a252794e4037556
2016-12-20 17:14:19 +01:00
hjk
fb57391767 Debugger: Make gdbbridge fetchVariable output similar to lldbbridge's
Change-Id: I11fc7d163dbd6b7deb5e88cac65dc61df3352411
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-19 10:37:16 +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
5c2a7b57e4 Debugger: Mimic parts of lldbbridge in gdbbridge
Make code more similar for later sharing.

Change-Id: I260e10ba1b613dfcebc45bb1a268b6fcebbde353
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 07:41:34 +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
26331f771a Debugger: Avoid messagesboxes on the same topic at the same time
Task-number: QTCREATORBUG-16971
Change-Id: I625f04cbd8f609c66597450dbad22ebc6eadcfe5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-14 14:10:14 +00:00
hjk
af3834f1ee Debugger: Force direct engine shutdown on GDB crash
Task-number: QTCREATORBUG-17341
Change-Id: I4011345fbd8810841f4236cc532a0eafcaf587b8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-29 11:41:41 +00:00