Commit Graph

331 Commits

Author SHA1 Message Date
Artem Sokolovskii
a9e8b106a4 Debugger: Fix hitting breakpoints repeatedly in multithreading
This change resolves an issue where gdb.parse_and_eval could
rerun the  multithreading application, causing breakpoints to be hit
repeatedly in different threads, leading to an infinite loop.

Added checkbox which enables skipping the execution of
gdb.parse_and_eval in few places that mitigate the issue.

Fixes: QTCREATORBUG-23219
Change-Id: I856d382d033f8a4da394d7422ebb3e131de28e09
Reviewed-by: hjk <hjk@qt.io>
2024-10-15 08:40:18 +00:00
hjk
3aee50f5fd Debugger: Paddle back on the (non-)auto detection of Qt versions
It looks like there are Qt-using scenarios without easy way to have
the right Qt version in the kit,

Among the frequent cases where we need to distinguish Qt versions in
the dumpers are the Qt5/6 container layout differences which can in
some cases be detected from the currently dumped value. Use that now
as the primary distinction and fall back to the previous expensive
peeking only if that is needed. This also postpones any Qt version
related activity until a real Qt type is encountered, i.e. does not
impact non-Qt scenarios.

Task-number: QTCREATORBUG-31033
Change-Id: I67b6e34c42994ad9f6e8ec8698b430b55327cf0c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-11 11:46:11 +00:00
hjk
3697aac20e Debugger: Speed up QObject recognition
Change-Id: Ib9847725c1e97ad774173ecb95094791ff5d1bbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-05-24 13:52:51 +00:00
hjk
6aab6f61b5 Debugger: Provider Qt version externally to bridges
Extracting within the bridges is expensive.

Change-Id: Icf69db4b112230cc23e331abc0b3eb0de1323f46
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-16 10:03:08 +00:00
Michael Weghorn
23b7ac84a9 Debugger: Use integer from native GDB value for typedef
Extend the solution from

    commit d86cf5e235
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Sep 24 12:02:06 2020 +0200

        Debugger: Retrieve and remember int from native GDB value

to also retrieve the int representation for numeric values
from the corresponding native gdb.Value if a typedef to
an integer or bool type is used, not only when an integer
type is used directly.

This makes expressions for bifield members in the
debugger's expression view show the correct value
when the type of those bitfield members is a typedef
to an integer type.

Extend the "Bitfields" dumper test accordingly.

One real world example where incorrect values were
previously shown is GtkWidgetPrivate from the
GTK library [1].

[1] ebc84a6185/gtk/gtkwidgetprivate.h (L39-76)

Change-Id: Ib39e00ebbfc8d7d9ab10dc89af61f37ec41fb4ee
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-08 06:29:35 +00:00
hjk
67072d3f5b Debugger: Re-work bridges
The type cache has been split into smaller caches for individual
aspects. Type ids are now integral, not strings.

In addition, there is new supporting code for logging, timing and
profiling

Change-Id: I6db72a149650d42aecf8b899869c542b1303d43b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-07 10:15:34 +00:00
Robert Löhning
0cca4b283b Debugger: Fix calls to calloc
Change-Id: Id1ba0c4656eb611b6ac4269ebf9d141feb08d632
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-04-03 14:38:44 +00:00
hjk
2886b2b383 Debugger: Robustify gdb stack frame extraction
frame.older() might run into invalid debuginfo and throw.

Change-Id: Iba1d395f21719bf28184302427c7ab2435c6a663
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-18 09:48:23 +00:00
hjk
1e7f68e296 Debugger: Fix Gdb CLI dumper output
Patch from hunk #2 in the report, hunk #1 was handled by 76260f8038.

Fixes: QTCREATORBUG-28659
Change-Id: I674b742869f8b834d039fbbfc599a3261d76b054
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-22 06:16:10 +00:00
Łukasz Wojniłowicz
b05a34b81e Debugger: Don't try to iterate on non-existent subprinters
gobject_gdb.py puts the pretty_printer_lookup function into
gdb.pretty_printers. Trying to access subprinters of it causes the
AttributeError exception.

Change-Id: I00ce7b62866dd9c06a1f0abef0c7043ece023d34
Reviewed-by: hjk <hjk@qt.io>
2023-01-26 17:09:11 +00:00
Łukasz Wojniłowicz
0648cd49f9 Debugger: Don't split top-level name into letters
If names = ['foo.bar'] then toExpand = ['foo.bar', 'foo'] instead of
toExpand = ['foo.bar', 'foo', 'fo', 'f']

Change-Id: Ia6e021b1f32d9f1e5a78209e9a269725e298409e
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 15:37:39 +00:00
Kai Köhne
4e9c1d126c Replace GPL-3.0 with GPL-3.0-only
GPL-3.0 is deprecated by SPDX.

Change done by

 find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \;

Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:05:04 +00:00
hjk
bb11788a0a Debugger: Avoid quadratic behavior for larger debug output
Task-number: QTCREATORBUG-28111
Change-Id: I0567b6af9f74c2d335d19a52765834ef7cee9449
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-08 13:53:30 +00:00
hjk
37db98db30 Debugger: Simplify TypeData setup and registration
Change-Id: Ib23249eae63901d614cbe33fe184f174a10efbe4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-28 11:59:50 +00:00
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
266adf7b1d Debugger: Delay template argument retrieval from native types
For performance reasons. They are often not needed.

Change-Id: I8a7bb03583b3ec2479a3691486c9c02f70ad014e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-22 13:26:02 +00:00
Christian Stenger
dde5a52693 Revert "Debugger: Drop support for backends relying on Python 2"
This reverts commit 43bcf91121.

GDB coming with MinGW shipped by Qt (e.g. 5.15  official) are still Python2 based.

Change-Id: Iad658de7a242345cc7f6081f26f0238071668a06
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-24 07:04:34 +00:00
hjk
43bcf91121 Debugger: Drop support for backends relying on Python 2
The last discussion of the topic was 18 months ago, and already back
then it seemed not widely used anymore. See
https://lists.qt-project.org/pipermail/qt-creator/2020-February/008382.html

Change-Id: I48c879ce918b7351b1120bd70892deb0330637f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-09 12:35:22 +00:00
Orgad Shaneh
7a7dc86716 GDB: Fix missing token on some responses
COOKIE FOR TOKEN 0 ALREADY EATEN (InferiorStopOk). TWO RESPONSES FOR ONE
COMMAND?

Change-Id: I569a9715f073f3fbba71045f14fa30a06cd434e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 12:48:11 +00:00
hjk
adf70fd8f2 Debugger: Don't add empty path components to solib-search-path
Change-Id: I417e5193749dae44d189fc0189a92899d738976b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 07:18:43 +00:00
hjk
185ceda8f1 Debugger: Make user defined gdb-style dumper work with arrays
Change-Id: I1667061eacf78a6fa4df567ea033e7bb5269da2c
Done-by: Bruno Vasselle
Fixes: QTCREATORBUG-26027
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 07:25:59 +00:00
Michael Weghorn
fd9ca07a11 Debugger: Import GDB pretty printers for new objfiles
Previously, if enabled in the configuration, system
GDB pretty printers were loaded only once for all
objfiles present at the point in time when the loading
happened, which meant that GDB pretty printers for
objfiles loaded later were not taken into account
and thus unavailable if they were defined in the
corresponding autoload scripts for the objfiles.

In order to make use of those as well, remember whether
loading of system GDB pretty printer is enabled, and if so,
evaluate the pretty printers set at the new objfiles
in the handler for GDB's new_objfile event.

Extract the functionality for handling one objfile's
pretty_printers to a separate function
'importPlainDumpersForObj' to avoid code duplication.

Note: For this to actually work, it is required that the
objfile passed to the registered GDB new_objfile handler
actually has the pretty printers set at this stage.
This was only recently implemented on GDB side, in
GDB commit 2c473def12b08100e6b56261f01112db7f6aeab5
("gdb: do autoload before notifying Python side in
new_objfile event", 2021-04-27, [1]).
Therefore, this currently only works with the current
development version of GDB built from its git master
branch, not with any already released GDB versions.
(When older GDB versions are used, this will just behave
as it used to, and the corresponding GDB pretty-printers
will not be used.)

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=2c473def12b08100e6b56261f01112db7f6aeab5

Fixes: QTCREATORBUG-25339
Change-Id: Ibc0ab16fbb75184fa199c0709bfc73954f04c193
Reviewed-by: hjk <hjk@qt.io>
2021-05-04 13:30:51 +00:00
Michael Weghorn
2d8dff4a8a Debugger: Avoid exception with GDB 10 to fix running dumper tests
Since GDB commit 1ba1ac88011703abcd0271e4f5d00927dc69a09a [1]
("gdb: Enable stdin on exception in execute_gdb_command",
committed 2020-01-24), stdin for GDB is re-enabled whenever
an exception is caught during 'gdb.execute()'.

When running the dumper tests for GDB, such an exception
was thrown when loading the qtcore library, resulting
in the GDB commands after the 'run' command (s.
'tst_Dumpers::dumper') to be be handled by GDB prematurely
when loading the library instead of when reaching the
end of the test program.

This resulted in the dumper tests failing with output like

    29: (gdb)
    29: &"up 0\n"
    29: &"No stack.\n"
    29: ^error,msg="No stack."
    29: (gdb)
    29: &"python theDumper.fetchVariables({'token':2,'fancy':1,'forcens':1,'autoderef':1,'dyntype':1,'passexceptions':1,'testing':1,'qobjectnames':1,'expanded':['local']})\n"
    29: &"Traceback (most recent call last):\n"
    29: &"  File \"<string>\", line 1, in <module>\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 711, in fetchVariables\n"
    29: &"    variables = self.listLocals(partialName)\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 597, in listLocals\n"
    29: &"    frame = gdb.selected_frame()\n"
    29: &"gdb.error: No frame is currently selected.\n"
    29: &"Error while executing Python code.\n"
    29: ^error,msg="Error while executing Python code."

Avoid the exception by first trying to 'gdb.execute' the
command that works for GDB 8+ and fall back to the command
for earlier GDB versions, i.e. reverse the order. That
should be fine for all GDB versions, given the commit
mentioned above is only contained from GDB 10 on.

While at it, move the assignment to 'cmd' into the
corresponding 'try' blocks to make the context a bit
clearer.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1ba1ac88011703abcd0271e4f5d00927dc69a09a

Change-Id: I2d1bb52a777801e6bd77a5eda581a2fd5dd3a18f
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:14:31 +00:00
Mattias Johansson
2081038953 Add gdb tracepoint support for Linux
Change-Id: Id2e46bae576a730f8c1b64a247aeed12e6d721af
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 07:36:07 +00:00
hjk
c2e3e0419d Debugger: Prepare delayed type creation for DumperBase.Values
Change-Id: I283bcdec178e0a860bef71753cd29cc283a58391
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-21 11:21:01 +00:00
hjk
398a74b027 Debugger: Adapt QObject name dumper to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: Iee8a71eda4c15b3cd36e569805fef769f6eb090f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 14:30:13 +00:00
David Schulz
3b611e07f7 Debugger: prevent calling functions with gdb on windows
and adjust tests accordingly

Change-Id: I172e08cfccc248eea06a94208c9e8e312d69e334
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-21 11:15:40 +00:00
Michael Weghorn
d86cf5e235 Debugger: Retrieve and remember int from native GDB value
When adding expressions for bitfield members in the
debugger's expression view, their corresponding 'gdb.Value'
does not expose the fact that those are actually bitfields,
so e.g. an 'int : 3' is exposed like a "normal" 'int'.

Previously, this would result in wrong values being
retrieved in the 'DumperBase::Value::integer()' function,
when trying to read the value from the corresponding
memory address.

To avoid this, retrieve the actual int representation
for numeric values from the corresponding native 'gdb.Value',
remember them and return that one, similar to how it
is already done for known bitfield members
(s. 'Dumper::memberFromNativeFieldAndValue').

The conversion from the 'gdb.Value' does not work
for integers of a size larger than 64 bits
(like '__int128' used in the "Int128" dumper test).
Therefore, just ignore conversion failures and don't
remember any value explicitly for those cases,
so the same handling as previously used is applied.
(At a quick glance, the reason seems to be that this
is because GDB's corresponding functions use 'int64'
as a return value of the relevant functions [1] [2],
but I did not look closer into what GDB does
internally.)

Corresponding tests will be added in a separate commit.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdbsupport/common-types.h;h=f5b2f3d249177acea77231c21c5601f959c18d2f;hb=f3034e25fa98d44b775970f40c9ec85eeae096e6#l33
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/python/py-value.c;h=6e29284aad11ff344789152a4f601b3474d86bb5;hb=f3034e25fa98d44b775970f40c9ec85eeae096e6#l1706

Fixes: QTCREATORBUG-24693
Change-Id: Idfc3390115e8796f3c778070c23424c3dbdfeddd
Reviewed-by: hjk <hjk@qt.io>
2020-09-24 13:11:47 +00:00
Dominik Holland
a535196c41 Add support for multiple Qt versions in "Load QML Stack"
Enable the functionality for cdb again.

Change-Id: I75405f830dd208cc110d6682a45beedf2f4199cc
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-09-11 08:11:21 +00:00
Orgad Shaneh
00e814fdd1 Debugger: Respect "Use Dynamic Object Type for Display"
Broke in 5efa84830b.

Task-number: QTCREATORBUG-24280
Change-Id: Ice4b9d826d2402efb354180886d35926a2513e5a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-03 09:07:46 +00:00
hjk
090110e1d8 Debugger: Fix passexception_s_ for GDB CLI
The intention was to always show errors, as this is likely an error
in the dumpers themselves. The case of operating on uninitialized
data is rather rare in the manual use case here.

Change-Id: I08874e302b402be94f760f744e82e127855dd16f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 12:34:21 +00:00
hjk
e87c301787 Debugger: Fix gdb command line use of dumpers
Fixes: QTCREATORBUG-24103
Change-Id: I4a771e3694879755c46623c8f089857437eb0fb5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 12:04:23 +00:00
hjk
7a63a47ef0 Debugger: Work around for gdb reporting zero array sizes in some cases
Task-number: QTCREATORBUG-23998
Change-Id: I101d032705b66faf50260067f6aa604214f09298
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-14 10:52:18 +00:00
David Schulz
df2efd7df6 Dumper: raise exception in gdbbridge callHelper on Windows
Gdb from MinGW 7.3.0 and 5.3.0 crashes on Windows when we try to
evaluate expressions that result in a function call. At least prevent
evaluating such expressions from within the dumper.

Task-number: QTCREATORBUG-23477
Change-Id: Ic14148a43b95aa1b52c1d4488958fa66eccdc0b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-09 09:20:06 +00:00
David Schulz
472797a1d1 Dumper: avoid redundant labeling
Change-Id: I85581cfe34a60e7f8a3e3590358443a15b7d2d4c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-02 12:14:22 +00:00
David Schulz
d91d4aa759 Dumper: remove unused imports
Change-Id: I447c9697dbd631ab26358c193c274484e70a908d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-02 12:13:34 +00:00
David Schulz
0776340ad8 Dumper: unify Codestyle
generated with autopep8 and the introduced setup.cfg

Change-Id: I5b55a7937f2cde81be59d2b434e94ada1a4af5ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-28 08:35:05 +00:00
David Schulz
4422805cec Dumper: replace xrange with range
Change-Id: I09b3dd4da548643e927dbc5bb3130c28a746396b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-26 10:26:55 +00:00
David Schulz
44db8e2eab Dumper: replace import * with explicit imports
Using imports like

 from foo import *

is considered as bad habit and it reduces
static code analysis usability.

Change-Id: I56a175f4c7b231e2b8e486bd9d1c65543720f56a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-25 13:22:50 +00:00
David Schulz
e17c96cf11 Dumper: move global enums and functions to utils
Change-Id: I11f5f0d970cd23a5fd907d33daa3cb8a441d0c58
Reviewed-by: hjk <hjk@qt.io>
2020-02-24 07:47:40 +00:00
hjk
dff4469baf Debugger: Use a more convenient way to create timing samples
Change-Id: I4ca983957c81a1f5f963a85b16a2d1b255b2cd2d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-07 12:14:27 +00:00
Eike Ziller
fcb12a275f Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/projectexplorer/deploymentdata.cpp
	src/plugins/projectexplorer/msvctoolchain.cpp

Change-Id: I64c304fc71435629a6a0060a9df71e8952699508
2019-10-16 15:27:22 +02:00
Michael Weghorn
e2e96cab52 GDB: Handle 'pretty_printer.to_string()' returning None
The documentation for the GDB pretty printer function
'pretty_printer.to_string' says [1]:

> [...]
> Finally, if this method returns None then no further
> operations are peformed in this method and nothing is printed.
> [...]

Therefore, skip this part if the printer's 'to_string' method returns
'None' and only fall back to assuming LazyString otherwise.

This e.g. fixes the std::pair pretty printer (for gcc-9 libstdc++6) for
which "<not accessible>" was shown previously in the debugger's
locals/expression view. Now it shows the object's address and allows
expansion to see the values for the 'first' and 'second' members.

[1] https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing-API.html

Change-Id: I33b1af82f731c347314af76c533b096b8a5afe21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 08:23:30 +00:00
hjk
3e2e0c6edc Debugger: Use GDB's own pretty printers more cautiously
Looks like there is no attempt made on the GDB/libstdc++ side
to recognize uninitialized objects, so we cannot convert
"all 932 million children, I swear" to a list.

Task-number: QTCREATORBUG-22887
Change-Id: I3bf7e53c8b11ece3e1182d8446e959a66a41665a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-30 06:27:24 +00:00
Michael Weghorn
0313cdbd87 gdbbridge: Convert children to gdb.Value
'Dumper::fromNativeValue' expects an object of type
'gdb.Value'. However, the 'pretty_printer.children()' iterator
may return values that first need to be converted to this,
as documented for function 'pretty_printer.children' at [1]:

> This method must return an object conforming to the Python iterator
> protocol. Each item returned by the iterator must be a tuple holding two
> elements. The first element is the “name” of the child; the second
> element is the child’s value. The value can be any Python object which
> is convertible to a GDB value.

Therefore, explicitly convert the value to a GDB value first.

This fixes the expansion of 'std::vector<bool>' when system
GDB pretty printers are enabled which previously led to
"<not accessible>" being shown e.g. for the following example
(expand 'v' in the local variable view at the breakpoint):

    #include <vector>

    int main()
    {
        std::vector<bool> v;
        v.push_back(true);
        return 0; // insert breakpoint here
    }

Side note: GCC's pretty printer for 'std::vector<bool>' previously
returned either '0' or '1' for the element values, thus leading to the
problem described above. With this patch in place, the elements are
shown when the vector is expanded, but the shown type is 'long long'
(since that's the type that GDB seems to automatically assign when
constructing a 'gdb.Value' from these integers, at least with
GDB 8.2.1 on amd64). This will work as expected ('bool' shown as
type) from GCC commit [2] on ("Have std::vector printer's iterator
return bool for vector<bool>").

[1] https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing-API.html
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6c7d761a3f5fd7d19795d1d4b9b027a04b3fe88b

Change-Id: I9047affa5b4369befd2e2386c8a6b04c66c4b632
Reviewed-by: hjk <hjk@qt.io>
2019-06-26 07:16:42 +00:00
hjk
7418c4f1ee Debugger: Adapt to new qt_v4StackTraceFromEngine helper function
Change-Id: I3d3dbd837e1b73117524e286ae4ea09e652e4a5c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-05-24 06:45:08 +00:00
Eike Ziller
b5e7522237 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/pythoneditor/pythoneditorplugin.cpp

Change-Id: I9a95df5e16b34538539ced7dfc5d326b700794e6
2019-04-02 12:22:48 +02:00
hjk
94d79ba3b5 Debugger: Fix "Break on Abort" with GDB > 8.1
GDB 8.1 changed behavior when specifying breakpoints, it now tries
to pattern-match function names, hitting e.g. 'Foo::abort()' for
'b ::abort'.

While the API exposes a way to opt-out of the new behavior there's
no way to tell when to do that other than trial-and-error.

Task-number: QTBUG-73993
Change-Id: Ied2e640e65e40df6eac50117db890bd4b51d36ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-01 09:28:04 +00:00
hjk
a89a885b2c Debugger: Fix "Load QML Stack"
There have been apparently changes on the Qt Declarative side.

Task-number: QTCREATORBUG-22209
Change-Id: Ia9e387aa92465556b5b8aee3661e2fc063478f3d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-29 15:04:35 +00:00
Joerg Bornemann
3fbd95cee4 Debugger: Fix typos in gdbbridge
Change-Id: I33f35353b08fdb26a5b78231dff5bfeb80325d14
Reviewed-by: hjk <hjk@qt.io>
2019-03-25 08:53:03 +00:00