Commit Graph

88 Commits

Author SHA1 Message Date
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
9894c6eaf0 Debugger: Convert to Tr::tr
Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-08 12:32:38 +00:00
hjk
d3786a895b Debugger: Use some Tr::tr in WatchModel related classes
Change-Id: I1fcd0c5f342da4fd5ff52c19eb9f3f20a9bdcc5b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-07 08:52:11 +00:00
hjk
2a5bdc893e Debugger: Robustify protocol
Chicken out of list parsing when an element can't be read.

Change-Id: Ia0c487c53984ee29ba1b561edc040aa1447493a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 06:11:44 +00:00
Jarek Kobus
3dc360f728 Fix matching closing square bracket
Task-number: QTCREATORBUG-25745
Change-Id: I63ceb93d6208fb3fe19b4c11c6963a69bc01f260
Reviewed-by: hjk <hjk@qt.io>
2021-05-20 11:13:39 +00:00
hjk
1d9f535c8a Debugger: Make GDBMI parser more robust
Task-number: QTCREATORBUG-25745
Change-Id: I1a4f89fc72433548d44461c3c7c02bd53708d12d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-05-20 10:57:44 +00:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
hjk
dda6775325 Debugger: Fix crash in GdbMi::parseValue with Qt 6
QString::begin/end may be null in Qt 6.

Fixes: QTCREATORBUG-25018
Change-Id: If50cb79c58096d5fa68e494e33bea131063968fb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-12-01 10:03:17 +00:00
hjk
eb45b8f9b9 Avoid more uses of non-explicit QChar(int) constructor
Will be gone in Qt6.

Task-number: QTCREATORBUG-24098
Change-Id: Id76b15bb11879b2e8ff0f71af45acbfb1720f763
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-10 12:27:36 +00:00
hjk
f08c3d150a Debugger: Fix parsing of octal-encoded gdb escapes
Fixes: QTCREATORBUG-24462
Change-Id: I89153a04eeef6a2e20fefef45e0efa3712ec0997
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-06 07:01:04 +00:00
Christian Kandeler
f87a7bebe9 Debugger: Make decoding hex-encoded floats more robust
Apparently, the values are sometimes transmitted without leading zeroes,
so insert them if they are missing.
This fixes a crash in the QV4 dumper test.

Change-Id: I7434c9c090524eecbf5c50e69ad49f5a6ca81e1a
Reviewed-by: hjk <hjk@qt.io>
2020-09-23 16:09:42 +00:00
Eike Ziller
2a70bc1d09 Debugger: Fix build with Qt6
QStringRef gone.
ViewOptions changed.
MetaType register stream operators automatically.

Task-number: QTCREATORBUG-24098
Change-Id: Ibf98561af951aa5fc4ec483d18dafeaad02e07c3
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:41:20 +00:00
hjk
ae2cc246c3 Debugger: Remove some uses of QRegExp
Change-Id: Ie5bd429468ac0e68fb48f4916d143b5812f54d77
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-19 11:15:14 +00:00
David Schulz
a7dd0e50a2 Debugger: make BreakpointParameters::fileName a Utils::FilePath
Task-number: QTCREATORBUG-23339
Change-Id: Ifc497c14589cd6df10d8219533e100f1919213b3
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:44 +00:00
Antonio Di Monaco
a10a35d9eb Filter leading GDB messages during version detection
When using GDB through a script, additional messages can be printed
before the line reporting the version number, and some digits of those
messages could be interpreted as a version value, leading to wrong
version detection.

This patch searches for the "GNU gdb" tag first, so the correct
line is evaluated.

Change-Id: Ief64a056a20a963ad01c44941777361abcce00fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2019-07-29 09:28:21 +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
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
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
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
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
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
Christian Stenger
23781b3abc Debugger: Fix detection of gdb on older SUSE
Broke with e8a8003b16.

Change-Id: I0e9662bc8fb4115de0c63d07c82de78ef73004a5
Reviewed-by: hjk <hjk@qt.io>
2018-03-01 08:10:11 +00:00
Antonio Di Monaco
e8a8003b16 Debugger: Fix wrong GDB version detection for SLES
GDB version on SLES is reported as

GNU gdb (GDB; SUSE Linux Enterprise XX) Y.Z.W

So, the content between parentheses must be skipped, otherwise
the wrong digits are parsed.

Change-Id: I05eb1373bc6558dfe088c1328142ff21d48f5591
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-06 10:56:49 +00:00
Orgad Shaneh
8116cb39e1 Debugger: Add missing breaks in switch statements
Detected by GCC7

Change-Id: Ic4a1f0adac486d3f6d0f7da15b24e983c17225f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-10 20:40:31 +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
Eike Ziller
1704c484a8 Merge remote-tracking branch 'origin/4.2'
Change-Id: I9006dd493707ae626ae3502541599c8789e1aab0
2017-02-27 15:17:37 +01:00
David Schulz
bb05b5ff11 Debugger: Pass Qt type info version to the debugger protocol
Fixes Qt 5.8 QDateTime python dumper.

Change-Id: If6fab7bf3ea63372ef01942bcaa2121eb9c2b6db
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-02-23 05:55:46 +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
62726c3f77 Debugger: Fix transfer of non-8-bit output with LLDB
Task-number: QTCREATORBUG-17533
Change-Id: Ib8f700cf1705273b22ee1ee4700d1a1d468fa2d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-22 15:49:26 +00:00
hjk
b99cb464fa Debugger: Add convenience function to pass lists of strings
... to *bridge.py and adjust surrounding code.

Change-Id: I398ecf10a6b9c76ebf5683d2f3a6c28b57343663
Reviewed-by: hjk <hjk@qt.io>
2016-12-15 16:53:24 +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
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
Orgad Shaneh
d0341214b6 Debugger: Add QTC_CHECK define
Used in some comments, but not in live code.

Change-Id: I1fc0301c1864fba541a27b4d77708e44231c0a2f
Reviewed-by: hjk <hjk@qt.io>
2016-09-13 10:05:11 +00:00
hjk
39206931f1 Debugger: Mark out of scope variables as such
At least LLDB reports sometimes out of scope variables as such.
Report them as "out of scope" instead of letting the common
struct dumper fail and report its generic "not available".

Change-Id: Ic9d0d196894ef811fab8e6a586bf55d80cd02e45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-21 13:29:57 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
hjk
be91d50e43 Debugger: Replace DebuggerDisplay enum by strings
Easier to coordinate between dumpers and watchhandler

Change-Id: Ide191a5786dc04ef22c3e9c8b0bec39f8f8c0f1d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 15:37:28 +00:00
hjk
c8c6c8ec50 Debugger: Replace cdb output encoding enum by strings
Change-Id: I05225f5be61fdaa448b9991b14056e89228c26a4
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-04 13:01:58 +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
c2bf384ac2 Debugger: Split DebuggerEncoding enum
... into a string specifying a kind of encoding (utf8, latin1),
an optional bytesize (2-byte integers, 4-byte integers) and a
flag whether the displayed value should get "..." around it.

Scales better than adding an enum value for each new combination.

Change-Id: Iffcb1e2f148f12da96e165559a976bd34026c649
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-21 07:32:14 +00:00
Ulf Hermann
fdf968debb Debugger: Handle JSON null values when translating to python
Change-Id: I47aaeb564107642543ba8038fc175a2c2203bebc
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-03 10:06:26 +00:00
Ulf Hermann
2186e42697 Debugger: Make sure there are no bools in Python code
Python doesn't like lowercase "true" or "false", so we have to
convert those to int before we send the command.

Change-Id: Id30ebbb0714cae23b030c78eec5e59378ac467bb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-30 14:15:19 +00:00
Ulf Hermann
1e58db55b3 QML Debugger: Add an explicit override for bool to DebuggerCommand
This makes sure we construct QJsonValues from bools, rather than
casting them to ints.

Change-Id: Ibc3e5322460e5bec153d80024219ba7935268d68
Task-number: QTCREATORBUG-15395
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-11-30 08:56:09 +00:00
hjk
b8ae9fd46d Debugger: Adjust native mixed debugging after upstream changes
Change-Id: I4d137fadd0de2aa346f2f49932faac4ee9ed41e7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-19 12:40:29 +00:00
Niels Weber
9dd457a678 Debugger: Fix a warning
Followup to 01006580c1

Change-Id: I4acd54472df03c019493426303d5a52a9902f9fd
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-16 08:17:49 +00:00
hjk
525c33f999 Debugger: Infrastructure for reworked native mixed debugging
- Remove old experimental native mixed approach.
- Move some common stack parsing to Stackhandler.
- Mark gdbbridge.py debug output explicitly to remove it
  from actual reponse handling

New native mixed needs QtDeclarative changes and
QTC_DEBUGGER_NATIVE_MIXED=1 for now.

Change-Id: I09eed1da51cea878636d36756015b7bfaed34203
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-09 05:19:45 +00:00
Ulf Hermann
d5707e0e32 Debugger: Use Qt's JSON encoder for debugger protocol
The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-15 08:28:14 +00:00
hjk
eca5ccdd3e Debugger: Debugger protocol maintenance
- Move DisplayFormat from watchhandler.h to debuggerprotocol.h
- Add/update a few comments about the use of the protocol enums
- Make decodeData take a DebuggerEncoding instead of an int

Change-Id: I50bed70a5da2e94da46e894bf9136bc14c9a1b23
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-12 12:59:41 +00:00
Jarek Kobus
9be93b6962 Still use 0 instead of nullptr in numerous forms of tr().
Looks like lupdate isn't prepared yet for nullptr.

Change-Id: I8341d6b11c63871b4d2240dd184228f53dcbf35c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-27 13:04:15 +00:00
hjk
9130cdfc05 Debugger: Use special values for translatable strings
... when passing data from the dumpers to the GUI. This reduces
the need to guess whether a value contains a translatable string.

Change-Id: I5e2210b8d028bd71f0087a2ba5c7c5b04331b882
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-21 10:59:51 +00:00
hjk
92f4ea3f79 Debugger: Use DebuggerCommand in QML engine
... instead of manually set up JSON. It's more concise, and paves the
way to use per-command callbacks as in the other engines.

Change-Id: Ib5cf9c9b882ec0ec87acd7c1ceb938d3ee60346b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-13 09:06:16 +00:00