Commit Graph

1392 Commits

Author SHA1 Message Date
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
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
David Schulz
ffe120a43f Debugger: imitate windows gdb all uppercase PATH env variable name
Task-number: QTCREATORBUG-19547
Change-Id: I57295b7febd7e017408d5d75ebec7020a7cbb32f
Reviewed-by: hjk <hjk@qt.io>
2018-01-03 12:04:49 +00: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
Eike Ziller
469edcdde3 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ic1ab71d0d40fa6c90e337c8ee9d9558e8f103eaa
2017-12-12 10:53:51 +01:00
David Schulz
1772808592 Debugger: use inferior device when run tool device is null
Task-number: QTCREATORBUG-19442
Change-Id: I6c2419b30bf86af79bb2436dc6dc8196f6c65f06
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-12-12 09:23:06 +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
hjk
81677fca97 Debugger: Move GdbEngine connections to constructor
In constrast to the LldbEngine this did properly disconnect
on restart, but moving it to the constructor avoid the need
to disconnect and follows the intended pattern.

Change-Id: I9a5727c1f6b76c0282de159251803f6ff5e76eb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-27 12:09:55 +00:00
hjk
35fa833f29 Debugger: Make AttachToRemoteProcess use the remote interrupt mechanism
... instead of trying to interrupt a local inferior with the same pid.

Change-Id: Ia5a3aa719f2df408f13dde48744c0d79a629addb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-10-20 14:34:39 +00:00
hjk
3d11a27ad0 Debugger: Consolidate "Attach to running process"
Change-Id: I78e89a662140f37f5f9719dbbbff070f1e2fbe84
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-19 08:31:33 +00:00
Leena Miettinen
2aed9f5c97 Debugger: Fix punctuation and capitalization of UI text
Change-Id: Ifbe95f063c00401f6ad777e95b0d0ee96c77969b
Reviewed-by: hjk <hjk@qt.io>
2017-10-19 07:23:03 +00:00
hjk
b76651bd72 Debugger: Do not duplicate state
GdbEngine::m_startMode should be always the same as in the RunParameters.

Change-Id: Iceac9b28b8273847f7ee518572d93e796fffeb14
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-10-17 08:52:00 +00:00
hjk
cc7754920c Debugger: Simplify use of DebuggerEnginePrivate members
Each engine has now the RunTool pointer, not just the master.

Change-Id: I6bab026998d5da5da82224bfaf4a93d3cfb3a898
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-13 12:35:43 +00:00
hjk
ad4ec4eb3c Debugger: Remove DebuggerEngine::m_lastGoodState
The only use left was a not-so-important debug message.

Change-Id: I91bd1b744fb2f173037777461dd15e7720421ccc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-13 12:34:42 +00:00
Orgad Shaneh
d10fafae71 GDB: Fix reading executable from core dump on Windows
Multiarch GDB on Windows crashes if osabi is cygwin (the default) when
opening a core dump.

Change-Id: Ic04d508d99a3e947e05dcf3adc8bb2b265edc16b
Reviewed-by: hjk <hjk@qt.io>
2017-10-06 06:56:40 +00:00
hjk
f5ac79a20f Debugger: Combine some gdb startup code paths
After splitting out terminal and core handling they are
essentially the same.

Change-Id: I603cea74186eada5728295b430c9385812dcc4cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-10-06 06:10:14 +00:00
hjk
b268abb100 Debugger: Cleanup some GdbEngine code paths
Either dead code, or "Adapter" related abstractions that are not
used anymore.

Change-Id: I1f2418db13d4891d36c10b488c522582eff8afc5
Reviewed-by: hjk <hjk@qt.io>
2017-10-05 13:32:23 +00:00
hjk
2564e8d782 Debugger: Move core file unpacking into RunWorker of its own
Change-Id: I99b7e6fc8eb9054a4135f693581575c3b8b541df
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-05 12:21:30 +00:00
hjk
0c8283234a Debugger: Simplify GdbEngine construction
Change-Id: I4af1cb7d7480b1db68693881254cbc89d985c33e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-28 07:52:16 +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