Commit Graph

1394 Commits

Author SHA1 Message Date
Christian Stenger
5f71a27f7b Python: Cleanup pdbbridge
Change-Id: I687f4dd777e7d3bdb4fd54e04b4c12cd66137bfb
Reviewed-by: hjk <hjk@qt.io>
2019-07-23 05:35:40 +00:00
Christian Stenger
8f2397b100 Pdb: Improve python debugging experience
Rename internally used classes and suppress them
explicitly while debugging python code to not display
them on the Locals and Expressions.

Change-Id: Ia396243172b2d138c9f4c81b2f1ed0fec0dce3d3
Reviewed-by: hjk <hjk@qt.io>
2019-07-23 05:35:27 +00:00
Christian Stenger
ea6592e9b4 Dumper: Fix handling of namespaced Qt
Change-Id: I5fae8dd0051596e3fb13cce32f282f3442adc8c0
Reviewed-by: hjk <hjk@qt.io>
2019-07-23 05:35:02 +00:00
Christian Stenger
90392397cb Pdb: Fix missing marker for locations on Windows
When parsing the file path of location information the
GdbMi parser expects UNIX-style formatted paths.
When debugging with the pdb on Windows we reported
Windows-style paths which in turn made the parser fail
and the stack never contained a file name and the
current location also had never a marker displayed.

Change-Id: I5216bbaf39ceead63efe8426561f132de3cd04a2
Reviewed-by: hjk <hjk@qt.io>
2019-07-23 05:34:42 +00:00
David Schulz
79f7605a0a Debugger: fix cdb dumper test for namespaced Qt
Change-Id: I5cbf1db4cffb19ee63ab80dcd6e2a8659cd44389
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-09 08:40:00 +00:00
David Schulz
853f1226e0 Debugger: Fix QStandardItem dumper test
Change-Id: Ic4b965da9589a7bade4f96226bff3bb14987602c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-02 08:26:23 +00:00
David Schulz
1571384e49 Debugger: add dptr child to QDir for msvc targets
Makes it possible to access the entry lists if these were populated by
the code.

Change-Id: I066824d2ce7f75a38d208155156c93d06458f8b3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-02 08:26:14 +00:00
Orgad Shaneh
55653db029 Dumper: Fix std::map<K, V>::iterator dumper
The iterator type is std::_Rb_tree_iterator<std::pair<K, V>>

Change-Id: I0ed2f2e6955deb4b402277fe0f3eb32b6af2d477
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-01 12:51:37 +00:00
Michael Weghorn
aedc0ca91b Pretty printers: Unify code for different allocators
The code path for allocators other than
'std::allocator' does work for 'std::allocator' as well,
so unify this.

This also fixes the case of std containers when
'std::allocator' is used and the compiler flag
'-D_GLIBCXX_DEBUG' in place which results in size assumptions
that were made in the now dropped path to not be fulfilled,
thus leading to an incorrect display.

Fixes: QTCREATORBUG-22606
Change-Id: I2b6f8ac9933b210d26197975017292e2fc227541
Reviewed-by: hjk <hjk@qt.io>
2019-06-26 13:40:13 +00:00
Michael Weghorn
5eba3bde93 Fix std::basic_string printer with custom allocator
This fixes expansion of 'std::basic_string' in the locals
view when a custom allocator is used (which previously
would result in "<not accessible>" being shown);
for example, when expanding 's' at the breakpoint
in the following example:

    #include <string>

    template<class T>
    class myallocator : public std::allocator<T> {};

    int main()
    {
        std::basic_string<char, std::char_traits<char>, myallocator<char>> s("hello");
        return 0; // break here and expand value of 's' in locals view
    }

Change-Id: I0ca98de50d83a1f6e6f019acc37a1302a05fdba8
Reviewed-by: hjk <hjk@qt.io>
2019-06-26 07:18:06 +00:00
Michael Weghorn
01f26bd5b7 Fix std::vector<bool> printer with custom allocator
This fixes the std::vector<bool> pretty printer, which
previously just showed "<not accessible>" for variable
'v' for the following sample code (with system GDB
pretty printer disabled so that the custom
pretty printers are used):

    #include <vector>

    template<class T>
    class myallocator : public std::allocator<T> {
    };

    int main()
    {
        std::vector<bool, myallocator<bool>> v;
        v.push_back(true);
        return 0; // break here and check value of 'v'
    }

Change-Id: Ia9883aa0b06a396cb3546ac2594a82c1b2062b80
Reviewed-by: hjk <hjk@qt.io>
2019-06-26 07:17:39 +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
93d2e3352c Debugger: Improve QObject dumper
Don't use two lookups for parent types and act on known null pointers.

While the machinery is robust enough to handle the result it's a
needless deviation in regular code path.

Change-Id: I6e50629cf554870a3ffb9f488f654e6ae557e5b3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-18 09:55:07 +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
Antonio Di Monaco
9d148276a3 Debugger: Do not make std::vector layout assumptions
... when non-std allocator is used.

This patch is a follow-up of 41da97fb2c.

Task-number: QTCREATORBUG-22040
Change-Id: Ib3e7699ccb77fd2c934d28367629d78dbf5379d8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-21 09:37:56 +00:00
hjk
cffc09e53d Debugger: Disable a few more Creator-specific dumpers
... that were not updated when the structures changed.

Change-Id: I1c06ac029f2057d618ce21b5da3edf9694cff63d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-17 10:34:30 +00:00
Alessandro Portale
5311708845 python scripts: Use "not in" operator to test membership
As per suggestion from Pyls, this changes
  if not needle in haystack:
to
  if needle not in haystack:

Change-Id: I4a482604e13e61ecee9e02935479632419710ff7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-10 05:53:39 +00:00
hjk
14300bd477 Debugger: Disable Kit dumper
Broke when Kit guts were converted to use unique_ptr

Change-Id: Id38d53c56448cd2edde09e3b27e38a24bcfbb37c
Reviewed-by: hjk <hjk@qt.io>
2019-05-09 12:49:55 +00:00
hjk
e95fd876aa Debugger: Make the time stamp recording option work for single items
Should help to drill down to individual expensive dumpers.

Change-Id: I983ba075231784f71dd9d5c3bda375a3ee508bf6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-12 08:32:52 +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
ad889d6707 Debugger: Avoid looking up QList<QFileInfo> in QDir dumper
Task-number: QTCREATORBUG-22000
Change-Id: Ibb24dc81282118c1f6fe97af451647a54ffcc8dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-04-02 06:38:44 +00: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
Eike Ziller
b3baed58c6 Merge remote-tracking branch 'origin/4.9'
Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
2019-03-21 11:28:21 +01:00
hjk
cc25120377 Debugger: Fix gdb command line usage of dumpers
Change-Id: I9d5924b6cac707372a95b2b31e270722a6202fc0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-03-19 14:16:49 +00:00
Michael Weghorn
b29296e9e0 Escape GDB pretty printer output
Hexencode the output from GDB pretty printer, since
Double quotes ('"') and potentially more characters
need to be escaped in order for the variable values
to be properly displayed in the variable pane while
debugging.

The 'utf8:1:0' parameter to 'putValue' (as compared
to just 'utf8') makes sure that no extra quotes are
displayed at the beginning and end of the value.

Fixes: QTCREATORBUG-22135
Change-Id: I4ad9fdc75d8f389cc4cdd18d5da1eec242f8a329
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 13:48:21 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
illiteratecoder
7236e340a9 Debugger: Fix std::{unordered_,}{map,set} dumper for libc++
Task-number: QTCREATORBUG-18536
Change-Id: I2842a525e99e4fcd9544a1f15bd42fd5c8c0c16e
(cherry picked from commit 7b39db9e8a)
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-06 14:15:14 +00:00
illiteratecoder
7b39db9e8a Debugger: Fix std::{unordered_,}{map,set} dumper for libc++
Task-number: QTCREATORBUG-18536
Change-Id: I2842a525e99e4fcd9544a1f15bd42fd5c8c0c16e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Jeremy Barenholtz <jeremy@illiteratecoder.com>
2019-03-06 09:58:19 +00:00
Christian Stenger
31e549a7dc Debugger: Improve lldb breakpoint handling
Inform QC about changed breakpoints on the LLDB side.

Fixes: QTCREATORBUG-21997
Change-Id: Icec25725f92d8a0b47f7dab2971c0c5eb5b23757
Reviewed-by: hjk <hjk@qt.io>
2019-03-06 05:43:12 +00:00
Orgad Shaneh
cbfc6e522d Merge remote-tracking branch 'origin/4.9'
Change-Id: I801042a53ae4d02d1891ea582ca9ea89b00d3181
2019-03-01 13:06:57 +02:00
hjk
2cfa3502c3 Debugger: Remove identical CDB implementation of loadDumpers
Change-Id: I83582821f0670f65c8f325c54707947741a3df17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 13:54:53 +00:00
hjk
41da97fb2c Debugger: Do not make std::string layout assumptions
... when non-std allocator is used.

Task-number: QTCREATORBUG-22040
Change-Id: I67785095f50058851c358a45ef19e0c41743fe4f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 07:36:13 +00:00
hjk
4652a2b1d8 Debugger: Add a simple dumper for QMargin
Change-Id: I42703846196862793bc51602da376e5e0408bbd0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-20 12:03:23 +00:00
Christian Stenger
064f43fecf Dumper: Add dumper test for QSizePolicy
Beside this fix handling of QSizePolicy for
namespaced Qt.

Change-Id: Icf4e3574f97653a7bd4d8b696c87c17ef4defefa
Reviewed-by: hjk <hjk@qt.io>
2019-02-20 05:53:36 +00:00
hjk
bfee82fa2c Debugger: Add dumper for QSizePolicy
Change-Id: Ib4d2597229f2808fcf79e76a9590b0e07989bfb9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-19 12:57:26 +00:00
Eike Ziller
868160f215 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8fed69168d87afafdb5acf4de4d5d30f9b4ebf5
2019-01-31 08:38:13 +01:00
David Schulz
11863cb517 Debugger: add cdb specific symbolAddress
Fixes: QTCREATORBUG-21864
Change-Id: I54d89fabd83dd06e5d733519f0b65416077323c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-28 09:25:20 +00:00
hjk
ac1d6d0bc8 Debugger: Fix Attach to process and Run in Terminal
LLDB 6.x and 7.x

Change-Id: I127ed1e14ccdd239646673f2460be46da22d4965
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-23 14:24:57 +00:00
hjk
587bd782aa Debugger: Reduce the amount of ignored stop messages with LLDB
This is a workaround for excess messages from the early LLDB 3.x times.
LLDB 6.0 is ok with and without this workaround, LLDB 7.0 does not
produce the excess messages anymore and the workaround leads to
real stop messages e.g. after a breakpoint hit being ignores.

Change-Id: I2fad014eb92e066b00dbfe590fe62c543e5343f4
Task-number: QTCREATORBUG-21615
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-23 12:56:12 +00:00
hjk
d22a6d29e8 Debugger: Make *__int128_t also available with LLDB
Change-Id: I114458e18e461596966d5ef1b8f38f3c5d8d5ee5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-21 11:43:56 +00:00
hjk
1327d9efc9 Debugger: Handle gdb builds without TYPE_CODE_RVALUE_REF again
Amends f75a7fa036: Not every gdb knows TYPE_CODE_RVALUE_REF, in that
case we ended up with no locals displayed.

Change-Id: I4dab1b18cdd46abf1a3a54a237f1cd314ac50feb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-21 11:17:59 +00:00
hjk
f75a7fa036 Debugger: Support rvalue references in functions args with gdb
Change-Id: I5383ffa38f07e3f191619555a9e735c211b3dd8b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-10 11:33:46 +00:00
hjk
2a67a86c2f Debugger: Add fallback when gdb.Value.cast() fails for typedefs
Fixes: QTCREATORBUG-18450
Change-Id: I9239beb7e1879a284e28a30579129fe487eb2dd2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 13:21:02 +00:00
David Schulz
18bee3a08f Debuger: Fix enum dumper (again)
Fixes: QTCREATORBUG-21726
Change-Id: I25f4a84d88a915247456ac8e12877d503ae0d49a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 12:55:18 +00:00
hjk
5a8b198b9a Debugger: Fix display of multidimensional C arrays
Fixes: QTCREATORBUG-19356
Fixes: QTCREATORBUG-20639
Fixes: QTCREATORBUG-21677
Change-Id: Ie28b51c6caf526e125234959cbf11503d0683dc7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 09:42:56 +00:00
hjk
81b6d4f637 Debugger: Robustify QEvent dumpers
There's no need to go through unknown enum sizes here, they are known.
Also, make it work for namespaced Qt. Avoid casts to typedefs.

Change-Id: I9c6fc44a03a0c245f05957306a129f6902f8cf85
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-12-12 09:27:20 +00:00
hjk
d4e79230d8 Debugger: Make LLDB startup failures more verbose
Fixes: QTCREATORBUG-19612
Change-Id: I7c8ebe3ec734265c8df8a684ccd6bb8991ea8390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-11 12:08:06 +00:00
Orgad Shaneh
4cb4b7ba99 GDB: Fix address resolving for typedefed types
Reported upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=23936

Fixes: QTCREATORBUG-21602
Change-Id: I0592679a6b5c4821175ef8e97e2206e0ac0be44d
Reviewed-by: hjk <hjk@qt.io>
2018-12-10 13:40:41 +00:00