Commit Graph

560 Commits

Author SHA1 Message Date
hjk
b9e26fcd37 Debugger: Load dumpers after possible user defined modules with CDB
As is done for GDB and LLDB.

Fixes: QTCREATORBUG-20481
Change-Id: I13e73789e175fdca675c25378a856a5482d9e8fa
(cherry picked from commit 0523a7f38b)
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-28 09:35:31 +00:00
hjk
0523a7f38b Debugger: Load dumpers after possible user defined modules with CDB
As is done for GDB and LLDB.

Fixes: QTCREATORBUG-20481
Change-Id: I13e73789e175fdca675c25378a856a5482d9e8fa
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-28 07:46:08 +00:00
Friedemann Kleint
963dc84cc5 Fix some deprecation warnings in basic plugins
Fix warnings apppearing in 5.13, for example:
warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
...
warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations]
warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
...
warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
...
warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations]
warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations]
...
warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations]

Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 09:32:06 +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
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
Eike Ziller
71d60ee9c8 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I522f91de70aff28692d7c3a050e8d52df0b82a76
2019-01-15 08:40:23 +01:00
David Schulz
6809848b23 Debugger: Fix step into after switching operate by instruction
Update m_lastOperateByInstruction by calling adjustOperateByInstruction
before checking before checking the value.

Change-Id: Ic58da417f83381d9a2300ac0e5fcd2c06f41fc34
Fixes: QTCREATORBUG-21708
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-08 08:50:30 +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
David Schulz
dd350d1955 Debugger: Fix fetching memory
Do not dereference function parameter in async callback.

Change-Id: I9a6cebdc59579f230a5f570969c9cd1c6417edfc
Reviewed-by: hjk <hjk@qt.io>
2018-11-12 12:40:16 +00:00
Eike Ziller
fd7cba88ef Merge remote-tracking branch 'origin/4.8'
Conflicts:
	doc/src/editors/creator-only/creator-code-pasting.qdoc
	src/plugins/android/androidbuildapkwidget.cpp

Change-Id: Iea8b7135643d14ffe49d10b14bedb8fa5ac48063
2018-10-24 13:58:45 +02:00
David Schulz
a775c9fddc Debugger: set disabling/enabling subbreakpoints with cdb capability
Change-Id: I11a35394b9aabaaf58a99e800c1ba0f7d58c5e9c
Reviewed-by: hjk <hjk@qt.io>
2018-10-23 13:00:02 +00:00
David Schulz
08e27a5542 Debugger: Do not use deprecated bp model id to construct response ids
fixes breakpoint deletion

Change-Id: Ie5bda4e2664338ad4210f275abca374c6918753c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-23 11:57:21 +00:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00
David Schulz
45666dc932 Debugger: Do not interrupt twice
Fixes unwanted interrupt after setting a breakpoint to a running
inferior.

Change-Id: I8d24fd4beff53fa74f92d2134866d418745fa747
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-22 13:01:00 +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
David Schulz
b626a097c1 Debugger: always report that the debugger stopped when hitting a bp
...not only if the response id is known. Fixes stepping out with cdb..

Change-Id: I07dfc2b89703d5d0df80a30a658274529a68d18c
Reviewed-by: hjk <hjk@qt.io>
2018-10-22 04:46:42 +00: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
hjk
86cd29b13c Debugger: Simplify thread switching more
This moves the thread switcher combobox, the only consumer
of part of the threadhandler interface, into the threadhandler.

Change-Id: Icafd72e7777fad9196ce8fb33a79cae26c29a521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-03 11:37:17 +00:00
hjk
0c58248894 Debugger: Fix cdb switching back from stopper thread
Amends 9f9c72302f.

Change-Id: If97ca13de30fa4d24deddd58177f55e2c71010a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-03 09:02: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
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
David Schulz
0c1191886a Debugger: fix initial value of operate by instruction for cdb
Change-Id: Ifad9fdd96175a304130b8f41f53c235c0260220d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-21 06:29:33 +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
David Schulz
7bc14bf349 Debugger: add option to disable task entries for exceptions
Task-number: QTCREATORBUG-20915
Change-Id: I3b7bda65f5b645cd4d8f9582b9185cb27b2c9f91
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-15 07:46:33 +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
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