Commit Graph

73 Commits

Author SHA1 Message Date
hjk
4ceeeca715 Debugger: Remove some uses of FilePath::toFileInfo()
Change-Id: I78037741084630fc6852f5805595ec2943db64d2
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:46:08 +00:00
hjk
4652ef286b Debugger: Show output of debugger detection
... in tooltip of debugger path lineedit.

Helps with cases where necessary libraries are missing.

The tooltip is a bit hard to recognize, but as such cases now also
are marked in red text there's at least some direct hint that something
is not ok.

Change-Id: Ic5da8dcb1921a98f91f6eed755fa87ce5feed698
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-06 11:12:12 +00:00
hjk
7b7fb9f6c7 Debugger: Code cosmetics
Namespaces, names, ...

Change-Id: Id0b65585b8849e8bb47d63f6eba1c23b9db1a2c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-14 09:31:46 +00:00
hjk
076d1bf10a Docker: Fix debugger auto-detection
Mark detected debuggers as such and give them some bonus to match,
overriding other hacks.

Change-Id: Iaf4d88fa22dd50e68124b61087d4c742f7a56d0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 08:28:56 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Cristian Adam
ee33fd6409 DebuggerItem: Pass environment to debugger probing
QNX 7.1.0 requires that the QNX specific environment variables are
present at the time of running the gdb executable.

Without this the QNX Device configuration fails with the:
"Configuration already exists or is invalid"

Change-Id: I1cb8da58247247ac8248cb613f73e2e28d350e9e
Reviewed-by: hjk <hjk@qt.io>
2021-05-07 13:45:35 +00:00
David Schulz
5cd057d9fe Debugger: Prevent calling windows lldb on startup
The LLVM package on windows contains an LLDB linked against python but
misses a python library. Calling this lldb to get the version number
results in an ugly error message that python36.dll cannot be found. Use
the file version info instead.

Fixes: QTCREATORBUG-23848
Change-Id: I6d8e6cac07b427de564eaaedf7de369391aed37e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-24 13:52:58 +00:00
hjk
79010891e1 Debugger: Drop clang and llvm revision from LLDB version number
They are mentioned as separate lines in the lldb --version output
for self-build lldb binaries.

Change-Id: Ib0d6e46874ad5b576ac20a6aeab823d51571c0f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-08 10:59:05 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
hjk
37b079a19c Debugger: Some FileName cosmetics
Use {from,to}Variant for settings, and one time fromUserInput is enough.

Change-Id: I5774f425a4c775b0d78b87c60eabf7f48d78a082
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-14 12:30:32 +00:00
Denis Shienkov
96c1fbcd0a BareMetal: Long live support for KEIL uVision v5.x debugger
This patch adds debugger integration from the KEIL uVision IDE:

* http://www2.keil.com/mdk5/uvision/

This IDE has the uVision Socket Interface (UVSC) that allows
to the applications configuration, building and debugging:

* http://www.keil.com/appnotes/docs/apnt_198.asp

Besides, it provides a binary client libraries for Windows, which
are implements some API which we are use in this patch.

Currently implemented the following features:

* Enumeration of a stack frames.
* Enumeration of a threads (tasks).
* Registers view (read/write).
* Local variables view (read/write).
* Watchers view (read/write).
* Disassembler view.
* Current location marker.
* Break-points.
* Step-in.
* Step-over.
* Step-out.
* Step-by-instruction.
* Start/stop/pause/continue debugger.
* Auto-detection for the installed uVision instances (as debuggers).
* Wizard for choosing and configuring of the UVSC debug providers.

At this moment added support only for the 32-bit ARM devices, provided
by the STMicroelectronics:

https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html

For this are implemented two debugger providers:

* Simulator - allow to simulate the target device.
* ST-Link v2 - it is a HW debugger.

This implementation tested only with the QBS using the following
target boards:

* NUCLEO-F767ZI (based on STM32F767ZIT6 MCU).
* STM32F4DISCOVERY (based on STM32F407VG MCU).
* STM32F103x (based on STM32F103C8T6 MCU).

A more detailed information about this patch can be found in a
bug-tracker.

Fixes: QTCREATORBUG-23426
Change-Id: Ie36a1f7430b56c33d6665cc35e43fe9bd95d28f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-04 13:48:47 +00:00
David Schulz
6fc24653b8 Debugger: prefer cdb for msvc targets
Change-Id: I4d305ae6f3b54d7f724f2cfbde6062663e3c0ad1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-30 13:43:42 +00:00
hjk
ddf0dd8734 Utils: Add a FilePath::isDir() convenience function
Change-Id: I1df0ee1b136299ae6e4f2e5bd0bdc24bfeca33dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-11 12:46:10 +00:00
hjk
7705fbb701 Debugger: Code cosmetics
Remove uses of foreach, ...

Change-Id: I3997d4dffc63d58c386c70b08063ecb894ef1abb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-26 10:13:27 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
2ac89cba92 ProjectExplorer: Use an alias for QList<Abi>
Change-Id: I69231c5974620ae30296bfc4e0ab41c900d95a3c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-27 09:35:53 +00:00
Christian Kandeler
ce19540b77 Move KitAspectWidget definitions alongside their KitAspects
A KitAspectWidget class is tightly coupled with the respective
KitAspect, and no one else ever needs to see any KitAspectWidget
subclass at build time.

Change-Id: I1883af3b054c225e1ff5dd913118715bfdbaacfc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 14:39:29 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Michael Kopp
7e45ccc99b determine gdb target ABI by parsing 'gdb --configuration'
Currently, the gdb target ABI is determined by running
`gdb -version`, which for recent gdb's does not reproduce
the target ABI string -- yet this string is searched in
the output.  This obviously fails, and qtcreator uses a
fallback behavior, that is not suitable when using gdb
for debugging on targets (like avr microcontrollers).
With this change, QtCreator calls `gdb --configuration`
if that is supported by gdb and extracts `<string> from
`--target=<string>` in the output.

For older versions of gdb (which do not support the
`--configuration` flag, but still have the target
information in the output of `--version`, the output of
`--version` is parsed.

If both methods fail, no ABI is set for gdb.

Change-Id: Ib406f6700b63e2cedb46bd4ec8cc0d215677ecdc
Reviewed-by: Michael Kopp <kopp.michael@yahoo.de>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-13 21:35:28 +00:00
hjk
a69ae41fbe Debugger: Fix version parsing for LLDB
Ignore trailing newlines.

Change-Id: I2d4a4ce67abd016fc0ce669fe5f51ba60885ccef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-07 06:50:53 +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
7c562f1d4b Debugger: Remove unused DebuggerItem::m_autoDetectionSource
Change-Id: I02fb55cea393a4d8167942f66bdeb0af4e385e2c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-16 11:31:07 +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
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
Tobias Hunger
4ceed778f8 Abi: Clean up constructors
Only have one constructor. Get rid of implicit conversion from QString
to Abi -- that seems rather non-obvious. Use Abi::fromString(...) instead.

Change-Id: Ic638d3d4022c465123449089b0679197a5eb445d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-15 12:12:01 +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
James McDonnell
e69c2eb2d5 Make QNX a separate OS type
Limits conflicts with Linux tool chains and debuggers.

Change-Id: Ie6408aecbc2828e8be53c46cf579441ccaba19bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 14:32:11 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
hjk
99f2c07403 Merge DebuggerItemManager and DebuggerItemModel data
Change-Id: I400fe94316433c538f82badde12ad704d722d730
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: hjk <hjk@qt.io>
2017-01-16 17:29:34 +00:00
Ulf Hermann
018ba5a834 Rename the "ERROR" icon to "CRITICAL"
We mostly use this icon in terms of showing messages which might be
informational, warnings, or errors. We cannot call the icon "ERROR" as
that clashes with some macro on windows. To be more inline with Qt's
predefined messaging macros (qDebug(), qInfo(), qWarning(),
qCritical(), qFatal()), we rename the icon to "CRITICAL" and regroup
the entries in the header to suggest this usage.

Change-Id: I89880919d7ca54ea9c86de384eb29f375bf3075f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-02 12:27:54 +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
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +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
Tobias Hunger
5d3823ac47 Use SynchronousProcess::runBlocking
Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.

This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.

Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-26 11:50:03 +00:00
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.

Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-11 10:04:38 +00:00
hjk
35a16cc394 Debugger: Make some of the plugin tests compilable again
Change-Id: I5c3885cb385dc1c15dce14f2ff52bf70edee8399
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-16 14:04:05 +00:00
Orgad Shaneh
383737d020 Debugger: Update debugger details when executable is replaced
Store last modified time in persistent storage, and if it is changed,
reinitialize the item.

Change-Id: I15e8c843fecd3cebd528f2dadb64645828a2b221
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-07 07:27:14 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
hjk
e57b0db0f9 Debugger: Add missing #include
Needed in some configurations after 97e9f11387.

Change-Id: I905021575220171ed1d06dfa59873660f695e53f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-28 07:20:26 +00:00
hjk
97e9f11387 Debugger: Allow LLDB-MI to be used as debugger
That's LLDB's "compatibility" mode faking a GDB 7.4 interface.

This is not directly needed given Qt Creator's native LLDB support
but might be a useful fallback in some setups.

Change-Id: Ia2c1c731de46b8c668bb0c822f1438fe203aa9c5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-28 06:13:29 +00:00
hjk
b0e7368d58 Debugger: Mark bad debuggger entries with an error icon
Change-Id: If3f7ab4ea015be6f580f748f9d0ee19c608a0239
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-07 10:36:52 +00:00
hjk
5558615510 Debugger: Avoid warnings about wrong cmd line option to CDB on startup
Task-number: QTCREATORBUG-14100
Change-Id: I88775b51587120a765cdfcde798b0ac7313ec7ab
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-05 17:32:39 +00:00
hjk
04532fe604 Debugger: Add some expandable macros to Debugger options page
New %{Debugger:Name} for global use, %{Debugger:{Type,Version,...}}
for expansion within the name. Also re-initialize from file if the
saved version is empty (e.g. if the debugger was registered before
the version field was present)

Change-Id: I45568d78147597b30074a2ce4ddcf569bce15192
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-04 13:01:13 +00:00
Friedemann Kleint
991cf84991 Clean exported headers of the Debugger plugin.
Change-Id: I70ca6773e0f6aa6d80a441f8920d7f5d2418e1bf
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-26 14:49:20 +00:00