Commit Graph

1327 Commits

Author SHA1 Message Date
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
Friedemann Kleint
14eadb0f6d Fix accessing temporary copies via QStringRef
Amends change 840e787175

Change-Id: I633500b0fdbeeeb8b3d8accd3aec1e2990c62bca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-28 08:25:14 +00:00
Friedemann Kleint
840e787175 Use QString::splitRef() instead of QString::split()
Avoid string allocation where it seems feasible.

Change-Id: I61b23d4ef8a459f5aa77727a75f4e1d2b140da3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-25 11:32:47 +00:00
hjk
61b408d110 Debugger: Force flushing of GDB output
... after continue and step. Otherwise there would be no reaction
after the inferior gets an external SIGKILL while stopped.

Task-number: QTCREATORBUG-17280
Change-Id: I57933e92194a3320d7aba81055755477f34af382
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-18 07:07:39 +00:00
hjk
e265c5403b Debugger: Merge two variants to set detach-on-fork
Change-Id: I8459110b2729c0ee8c797f184c018fdb44cafe45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-15 08:26:18 +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
Christian Stenger
5711a74d0a Debugger: Remove now unused functions
Change-Id: I85c27bd11a5bbe35a911f6aa2d6f628d7f0ffa28
Reviewed-by: hjk <hjk@qt.io>
2016-10-12 07:33:32 +00:00
hjk
cb7fb51313 Debugger: Fix QML extra stack loading for GDB
Change-Id: I702bb8f183e93fe25857115225fa55607ffb1674
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-12 07:04:56 +00: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
Jake Petroules
f41b48ef5d Rename Abi::MacOS/GenericMacFlavor to DarwinOS/GenericDarwinFlavor
This makes clear that the ABI encompasses all Darwin platforms (macOS,
iOS, tvOS, watchOS) in the wake of the OS X to macOS rename, and would
have been more technically correct anyways since ABIs are far below the
"macOS" parts of our favorite desktop Unix operating system.

Change-Id: I16d1477f44ffe70e5d8cddd67199a1602ba6fd97
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-22 12:54:06 +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
hjk
6897dfa164 Debugger: Remove 'nopass' on SIGSEGV GDB handler
This has been used since the dawn of time but seems to cause problems
with JVM code.

Task-number: QTCREATORBUG-16565
Change-Id: Iae8a2949671d162f84b9dfe954c8dfbbd743a8de
Reviewed-by: Sandro Mani <manisandro@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-13 06:05:10 +00:00
hjk
7e8d9835f7 Debugger: Do not pass inferior output unncessarily through MI parser
Change-Id: I809c6bf9cd1b97a728af341819b3f009335ffa36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-14 05:43:43 +00:00