Commit Graph

1562 Commits

Author SHA1 Message Date
Eike Ziller
88b29792cb Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/android/androidrunnerworker.h

Change-Id: I52b9117c8a57dc4a34cfc09d1ae9bc76e0752bfc
2019-02-04 15:21:55 +01:00
hjk
18f1a8d759 Debugger: Fix gdb detaching
Too much cleverness in python command detection: "attach" is parsed
as possible Python command. Make it explicit that it is not.

Task-number: QTCREATORBUG-21908
Change-Id: I68444bccfb485ef1befe81b4b6b13243c2c8a500
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-01 13:50:11 +00:00
Alessandro Portale
710e57a628 Fix warning: "Use midRef() instead of mid()"
[-Wclazy-qstring-ref]

Change-Id: If8a0844b39377feb3772542559655854a92b93cd
Reviewed-by: hjk <hjk@qt.io>
2019-01-17 13:00:37 +00:00
hjk
6974b34b86 Debugger: Gracefully recover from gdb crashes
Fixes: QTCREATORBUG-17341
Change-Id: Icc05b9810269e43ddcf968cf25d5949b3687838d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-08 15:04:52 +00:00
Eike Ziller
9084ca73df Merge remote-tracking branch 'origin/4.8'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
2018-12-12 09:44:13 +01:00
Aaron Barany
f635af8908 GDB: Don't reset breakpoint when line numbers differ
When the breakpoint is put on a non-code line, it will be moved to the next
line that has debuggable code on it. When attempting to reset the
breakpoint to the originally requested line, this causes an infinite loop
of removing and re-adding the breakpoint.

Fixes: QTCREATORBUG-21611
Fixes: QTCREATORBUG-21616
Change-Id: I8943de0eae991644eb6728f491010599f62192ff
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-12-11 10:29:27 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
hjk
185f8985c6 Debugger: Fix unexpected state transitions with GDB
... for temporary stops.

The transition is not unexpected, we just failed to communicate the
expectation.

Change-Id: I30cdcffdcc3672e759023cd0c07de4bea11c2e32
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-30 13:51:47 +00:00
Orgad Shaneh
5170dd0858 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8bf92c8effdee0e1085730cb975ff88c8ad85fc
2018-11-20 19:13:13 +02:00
Orgad Shaneh
3a5e67a3d4 Debugger: Remove unused NativeMixedCapability
Change-Id: I8f36d52bced8fdecd0667c9bac069b833200d6b3
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 10:25:52 +00:00
Orgad Shaneh
14bdcd2bff GDB: Support operate by instruction also for core dump
+ Deduplicate common capabilities.

Task-number: QTCREATORBUG-21454
Change-Id: Icd53b88274136c885b929030f1cfb71819667cc3
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 10:25:44 +00:00
Eike Ziller
3d1d9aae2e Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/winrt/winrtdevicefactory.cpp

Change-Id: I33b8697e2ebf2bea051d7f1144449e0743ee16a5
2018-11-19 10:00:18 +01:00
Orgad Shaneh
fed9ac43f0 GDB: Enable adding expressions for core dump
Change-Id: I998bf3f3a7a719dc9b80492e55ffe5ace56ef461
Reviewed-by: hjk <hjk@qt.io>
2018-11-14 15:43:11 +00:00
Eike Ziller
3666e3aaeb Merge remote-tracking branch 'origin/4.8'
Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
2018-11-09 13:30:40 +01:00
hjk
3cef77db86 Debugger: Ignore bogus signal number on QNX
Fixes: QTCREATORBUG-21351
Change-Id: Id2b45e830f860a9352aacbbd5f6932d8fcde7b26
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-09 11:33:42 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
hjk
fa96f73192 Debugger: Rework step{In,Out,Over} handling
Main menu action pass operation to current engine, everything else
is handled there.

Combine execute{Step,Next} and execute{Step,Next}I functions.
Implementation were mostly similar, in some cases unneeded
(the instruction-wise version e.g. for Python)

Drop GDB-isms 'step', 'next' in favor of 'step in' and 'step over'.

Change-Id: I232232bc7a67d9d297a74f1c81dc43be96787d34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 10:34:31 +00:00
Orgad Shaneh
147a3c27c4 Debugger: Strip QLatin1* where possible
Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:32:31 +00:00
hjk
36b654567d Debugger: Finalize moving Operate by Instruction to engines
Fixes: QTCREATORBUG-21211
Fixes: QTCREATORBUG-21212
Change-Id: I6c0259052336f2141462157c319abeaec9a1e483
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-05 12:54:44 +00:00
hjk
4b42789bda Debugger: Privatize GdbMi::m_children
Change-Id: I6e51290c4521be40f516a452f32bdc82a4c051e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-26 06:15:41 +00:00
Orgad Shaneh
c83b5afa9b Debugger: Support core input in custom thread names
GDB doesn't provide thread-core on core dump debugging.

Give the user the option provide it.

Change-Id: I15eae0280243ce307b9045be33e4b28e9b9c64d0
Reviewed-by: hjk <hjk@qt.io>
2018-09-19 17:07:26 +00:00
Orgad Shaneh
a5533fefd1 GDB: Avoid running internal commands for breakpoints with 'c' command
Do not try to read locals and threads when hitting a breakpoint with
"continue" command, as it doesn't really stop.

Change-Id: I2adc02d9f94375c390a874122afe2a82a764dc64
Reviewed-by: hjk <hjk@qt.io>
2018-08-31 14:03:43 +00:00
hjk
06f3d2bf10 Debugger: Make updateThreads() a setThreads()
(and keep updateThread() for the single-thread case)

All backends create full lists, making that explicit allows to
simplify the interface.

Change-Id: I717cfcf3ec9f8e81df8a5dfc71ae84855bc3beae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-31 08:39:36 +00:00
hjk
cc198547e9 Debugger: Replace module polling in gdb by handling notifications
Explicit polling is still available and accessible as fall back in
the gui, but is at least in theory not necessary anymore.

Change-Id: Ifd184fb88bdbf5de53f5776e2c94a03f8ad44a06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-30 12:07:20 +00:00
hjk
2d631c7a0b Debugger: simplify GdbEngine::handleAdapterStartFailed
Both branches did effectively the same.

Change-Id: Iebfc3ace62acd3bd6f73fb1ee8573d8e884237c3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-30 12:07:03 +00:00
Ulf Hermann
4ecc46626b FileInProjectFinder/Debugger: Use Utils::FileName for sysroot
Change-Id: Id937f927ba6137fd04f742f31d1b260afbe42db4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:27:30 +00:00
hjk
9f9c72302f Debugger: Streamline ThreadHandler
- Use the TreeItem/data pattern recently introduced with Breakpoints
  to remove the need of keeping track of id/object mapping. Opens
  possibility to have thread groups as intermediate level.
- Use the ThreadHandler directly as model for the thread combobox
  to remove the need of manual combo box updates.
- Move setting current thread from individual engines to central code.

Change-Id: I030e21a4aa5ab30b0efbc84528d9cecf29cbbe30
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-21 07:25:57 +00:00
hjk
0769b0d65f Debugger: Simplify GdbEngine::handleExecRun
Combine two branches. The function is only used in the remote and the
local plain case, and the resulting actions were the same.

Change-Id: I30c0b4488f04667d88b69f2c8ecd1dead92e0766
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-08-17 16:03:42 +00:00
hjk
3b5ecac238 Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.

The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.

Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.

Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.

The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.

There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.

The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.

There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.

Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-08-17 12:35:15 +00:00
Eike Ziller
847787f146 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp

Change-Id: I72882df605bc3fc8a8d20118fd4e49207ac92664
2018-08-07 09:42:02 +02:00
Orgad Shaneh
787c4fc21e GDB: Escape quotes on breakpoint commands
The commands are wrapped in quotes, and if they contain quotes it gets
messed up.

Change-Id: I41cebd8cf4a57a8ea671e5f43a3295af1c73fd02
Reviewed-by: hjk <hjk@qt.io>
2018-08-03 15:23:02 +00:00
Alessandro Portale
0558db7b54 Debugger: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I91a6874f0d7b94e9079ab4ef07c23c60c80be9c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-25 12:52:43 +00:00
Orgad Shaneh
edc4ba10d5 GDB: Fix display of disassembly with optimizations
/m flag is deprecated since 7.11. Use /s instead.

See https://sourceware.org/gdb/onlinedocs/gdb/Machine-Code.html

Change-Id: Ie056bcf598da30976fca1622bc98eeb79a73f8e1
Reviewed-by: hjk <hjk@qt.io>
2018-07-24 10:39:06 +00:00
hjk
ef0cf8d1e0 Debugger: Continue startup in case of errors also in localized GDB
Change-Id: I7840e2a398e3ad50cb5526fa2a81584f02beec78
Task-number: QTCREATORBUG-20765
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-13 07:24:24 +00:00
Eike Ziller
3f356f31bc Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I3d42bd52fb7b977cfdfad83092fb6f6eac974e24
2018-06-06 09:57:01 +02:00
Christian Stenger
43fa0dfe6f Debugger: Avoid triggering Qt internal warning
Passing an empty string to QFile::exists() results in
'Empty filename passed to function' to be printed on the
commandline.

Change-Id: I028f0ec18447642b30be1a51f4c70b6ae18d45b1
Reviewed-by: hjk <hjk@qt.io>
2018-06-05 09:08:47 +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
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
Eike Ziller
c1c57f0c38 Merge remote-tracking branch 'origin/4.6' into 4.7
Change-Id: Ifddceb06f377ea428300fa8a48908cfc44b98705
2018-05-28 16:07:00 +02:00
hjk
d4ea80ef7c Debugger: Conceptually fix temporary stop of mixed gdb+qml engine
There's no actual change, the code could only be triggered when
the gdb side was active, but it triggered a stop of the combo
which then redirected to the active one.

It's always and only the gdb side that needs stopping, so do
it directly.

Change-Id: I1a6273b826be8f38993c9968d874b7b3daf0d0c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-24 10:15:35 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
f2a5932674 Debugger: Remove a too strict error handling
There's seems to be the possibility to actually trigger the assert
this patch removes with MinGW and mixed debugging.

While the reason for that is not clear yet, there's no need to
force the debugger to abort. The observer wrong state was InferiorRunOk,
so just continuing on the selected path will do the right thing
(i.e. attempt to interrupt the debugged process)

Change-Id: I534cedd71522e73d5f1097ddd472efbeb3b4d97f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-17 05:59:41 +00:00
hjk
fe38c3eb2b Debugger: Remove the RebuildBreakpointModel command flags
This was useful to trigger collective attemptBreakpointSync() in the gdb
engine when gdb did not yet track pending breakpoints by itself.

That's not needed anymore.

Change-Id: I8afd2955070504c6bd6ae6c028b3f006b6eb4d7c
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 09:05:35 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
hjk
37ef24114c Debugger: Move DebugInfoTask handling to plugin
This does not involve the engine (currently).

Task-number: QTCREATORBUG-19994
Change-Id: I07a628580bf99c988eb0df165d649d5cc0869c0d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-08 16:59:10 +00:00
Eike Ziller
c7fdb93865 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
2018-02-13 13:37:37 +01:00
Ulf Hermann
76c12becad Debugger: Properly handle spontaneous stop on InferiorRunRequested
We need to transition into InferiorRunOk first.

Change-Id: Iea4770f70979a4700a3bb350376526bbe8c07952
Reviewed-by: hjk <hjk@qt.io>
2018-02-12 15:28:26 +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
hjk
7c41720479 Debugger: Allow disabling individual breakpoint locations
... for breakpoints that resolve to multiple locations, like templates.

Toggling is done via the the breakpoint view context menu, for now
only available with GDB and not persistent.

Change-Id: I098ae13a5518e9f671c647680f8bd4413e7e5ccc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-01 10:20:33 +00:00
Robert Loehning
63e47f903f Improve translated strings and make them consistent
Change-Id: I88a6e6ceaa44b22539449037faa788caa9f349fc
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-01-22 11:56:01 +00:00