Commit Graph

450 Commits

Author SHA1 Message Date
hjk
b129cebccc Debugger: Fix manual splitting of complex template parameter types
Parsing has to stop at the first < (coming from the end).
foo::span<int>::bar<double> has a parameter 'double', not 'intdouble'.

Change-Id: Ied142d5e75a7587d6c0efd3b51608b199b999e93
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 09:24:38 +00:00
Orgad Shaneh
3eb36b556f Dumper: Add bitfield value in debugging message
Change-Id: I353e85b5b6999f85e93eed18ac0cf414c1c46066
Reviewed-by: hjk <hjk@qt.io>
2017-06-13 05:53:27 +00:00
Orgad Shaneh
a9145e67ba Debugger: Prettify values for enum bitfields
Change-Id: I55329bba1864c9ebbbcb3b3bf1b940346507f8cd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 10:40:46 +00:00
Orgad Shaneh
89057b552b Merge remote-tracking branch 'origin/4.3'
Change-Id: I56004e3ec9dc9d92d33bdae438c4f7e069eccc45
2017-06-02 15:13:51 +03:00
Orgad Shaneh
37b415379d Dumper: Introduce Value.__sub__
Change-Id: I27bf57e614630ac7b5bedb7f07e487676443f513
Reviewed-by: hjk <hjk@qt.io>
2017-05-29 10:37:37 +00:00
Orgad Shaneh
8430da3bf7 Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I01ab8c85ea3372b6dce4142ddb9cf92d903ffca6
2017-05-23 23:41:40 +03:00
Tor Arne Vestbø
5bc796094a Allow custom handling of python Dumper warnings/exceptions
Change-Id: I04108a09c317675d597bb6d0d58331c70ce02fb9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 12:38:16 +00:00
hjk
99ac955664 Debugger: Fix display of pointers as arrays
Task-number: QTCREATORBUG-18204
Task-number: QTCREATORBUG-17803
Change-Id: I4efe359c206b53ef773127cf29107d3cce720819
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 11:55:58 +00:00
Eike Ziller
64b19af7dd Merge remote-tracking branch 'origin/4.3'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6d89ea588de955f5d878500b59285d3adde6c77d
2017-05-15 15:31:55 +02:00
Orgad Shaneh
f603a115d0 Dumper: Put object address for pointer also when it is not dereferenced
int main()
{
    int foo = 42;
    void *bar = &foo; // bar has no object address
    return 0;
}

Change-Id: I917c2976bd618c096bfd704abff8b3538e38a0d3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-12 08:04:21 +00:00
Eike Ziller
6e8ee7479e Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/debugger/cdb/cdbengine.cpp

Change-Id: Ib9aeccc4162c43e9ee3d85847d96678045625dd0
2017-05-09 15:07:30 +02:00
Orgad Shaneh
11dd4ab75c Debugger: Fix swapped object/original addresses
Task-number: QTCREATORBUG-17938
Change-Id: I71773893c2dde784c5d3f4c63e7efbbdad13916c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-09 08:28:12 +00:00
Orgad Shaneh
279192f17a Dumpers: Fix operator + for pointers
Add an extensive unit test to prevent future regression.

Change-Id: I38b74f9b4f5893285e9afff2ddecaaad106f4114
Reviewed-by: hjk <hjk@qt.io>
2017-05-08 06:58:48 +00:00
Eike Ziller
105b69836c Merge remote-tracking branch 'origin/4.3'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Id8b53b000f94a1b5ab923db79f67bad3276d09dc
2017-05-04 10:03:50 +02:00
hjk
81d9315587 Debugger: Add a boost::variant dumper
This requires making template argument extraction a bit more robust

GCC 5.4.1 created debug info only reports the first argument for
boost::variant<int, bool>:

    #include <boost/variant/variant.hpp
    int main() { boost::variant<int, float> v = 1; return 0; }

    py print(gdb.parse_and_eval('v').type)

      -> boost::variant<int, float>

    py print(gdb.parse_and_eval('v').type.template_argument(0))

      -> int

    py print(gdb.parse_and_eval('v').type.template_argument(1))

       -> Traceback (most recent call last):
          File \"<string>\", line 1, in <module>
          RuntimeError: No argument 1 in template.
          Error while executing Python code.

Change-Id: Iedca8b073078c93449ab61bb2cab05d6cd9803ba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-26 09:23:18 +00:00
hjk
c5d37af0e0 Debugger: Some support for 'long double'
Task-number: QTCREATORBUG-18023
Change-Id: I06783541668b95711cb5a45bf689c43b348ff624
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 15:00:59 +00:00
hjk
5784a96596 Debugger: Extract printing of dereferenced pointers into method
It's used twice, always for 'this', and whenever asked for by the
user's 'Dereference Pointers Automatically' choice, but needs to
be done at different times.

Change-Id: I4dc7340d0a4cb3eb0c7ff17d59e39be0e3870aa0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-25 10:24:50 +00:00
hjk
53ff0e1ca1 Debugger: Add a workaround for bad gcc debug info generation
Gcc does not write out full type names with 'using template ...', see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80466

This is in most cases harmless for Creator as dumpers are triggered
independently of template arguments. However, if the dumper takes
different code path based on the template argument type, as is
e.g. needed for std::vector<bool>, wrong results are produced,
as the type cache only used the template base name as type id.

Work around by mangling the id of the un-typedef-ed type into
the type id of a typedef, which, in case of templates contain
the full parameter list.

Change-Id: I63c59cccdc186b09ff780e9dfd57b0ad668ae98f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-20 09:15:59 +00:00
David Schulz
c00bb1dcfb Debugger: Pass uninitialized variables to the python dumpers
Reduces accessing uninitialized memory

Change-Id: I025e9070b9b17a806237619b484cb27230e7f494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 07:03:23 +00:00
hjk
79c3c4e5e5 Debugger: Remove unused Dumper.Type.field function
Change-Id: Ib7b1576d2b71b0e5f1648b51a4298b44581b1c2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-05 05:45:31 +00:00
David Schulz
16b3235003 Debugger: Catch memory read exceptions in getJumpAddress
Throwing an exception in these cases is not uncommon and should
be handled properly.

Change-Id: I8d4377bf26a4e31971da724904dd5ea5f01a95e1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-04 08:23:30 +00:00
David Schulz
86edeb9722 Debugger: Use native value for pointer dereference
Change-Id: Ibde6ff382e7adc0c196837c9eba04391c0a2c3a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-28 09:22:28 +00:00
Orgad Shaneh
91e9ba7ede Dumper: Remove unused function
Change-Id: Ibc8cf420170b084c05fdaf1d6a7b26594bcb3f24
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-21 14:57:29 +00:00
David Schulz
33e8f2e099 Debugger: Fix QObject detection on Windows
Change-Id: I054161dfde0c03167a6d57861b069c403330e746
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-21 09:04:34 +00:00
Christian Stenger
2b6a912e6b Dumper: Comment out unused function
Change-Id: Iafc2b0892739c43699631f6ca8ce0d51222c893c
Reviewed-by: hjk <hjk@qt.io>
2017-03-16 14:58:58 +00:00
Christian Stenger
8204d794e2 Dumper: Fix missing import
Additonally ensure that code path works with Python 2.7+ and 3+.

Change-Id: I6c7895eeb830259dc07bb7f64049ae51cb814c7f
Reviewed-by: hjk <hjk@qt.io>
2017-03-16 14:57:43 +00:00
hjk
fd0bf9df64 Debugger: Make QObject connections a bit better accessible
Change-Id: I5e70a61db73f89dc48efc82bc6aa4e42c44ba6d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-16 10:12:40 +00:00
hjk
61501042bc Debugger: Simplify Qt namespace guessing code
We get proper notification when QtCore is loaded now, and we either
got it, or not.

Change-Id: I9485126d9b15b8d859ba440f3ba1623f03527ef8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-15 11:36:18 +00:00
hjk
fb213b5826 Debugger: Use a named tuple for Dumper.Field
Makes it clear that this is meant to be immutable and is supposedly
faster.

Task-number: QTCREATORBUG-17823
Change-Id: Ie5d67b793e0bc4f704981d5161efc12bcc22100a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-09 08:20:46 +00:00
David Schulz
4f91cb3d0c Debugger: Do not lookup types when accessing the type name
Return the typeId instead of triggering a type lookup when accessing the
type name and no TypeData is available.

Change-Id: I4d46d5356d38184d73427e5a65c3986d30520cf9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-03-08 09:52:30 +00:00
David Schulz
530f7972eb Debugger: Optimize QObject::staticMetaObject lookup
Change-Id: I8c06472ce4e33b7c4203934d93b9cc8c8ae95ce2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-07 09:46:23 +00:00
David Schulz
51d14393c4 Debugger: Fix double and (unsigned) long long alignment
Change-Id: Ia1ee70a047b3e659730e5a19b874f1f2e567d8ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-03 12:57:28 +00:00
David Schulz
aafb17ae83 Debugger: Add enum value dumper to cdbbridge
Change-Id: I40f1556599be7581eeab0c75b034696ac22a7131
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-01 10:07:49 +00:00
Eike Ziller
e724934393 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	doc/src/qtquick/creator-tutorial-create-qq-project.qdocinc
	doc/src/qtquick/qtquick-creating.qdoc
	doc/src/qtquick/qtquick-uiforms-tutorial.qdoc
	share/qtcreator/welcomescreen/qtcreator_tutorials.xml
	src/plugins/git/gitgrep.cpp
	src/shared/qbs

Change-Id: I6f4d168d888d9547c3af0819f79cc9ebb4186ca0
2017-02-14 15:32:04 +01:00
Orgad Shaneh
2b50fec73b Debugger: Fix int casting for bitfields
Change-Id: Iea3647594ffa3b2024ae469d844fa73028a0ab62
Reviewed-by: hjk <hjk@qt.io>
2017-02-08 16:54:45 +00:00
hjk
92263a0535 Debugger: Do not try to access type information without loaded binary
Amends b5b233d69e.

Change-Id: I24857b1ddfd3e5e1d234aac4e9871df4faf1c8fc
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-31 14:09:36 +00:00
David Schulz
b5b233d69e Debugger: Hardcode QChar type
QChar lookup doesn't always return the expected type. Get ahead of
this by hardcoding the type data on initialization.

Change-Id: Ie25c27521afeddc3da917242ce64df3901bcc80b
Reviewed-by: hjk <hjk@qt.io>
2017-01-31 10:00:13 +00:00
David Schulz
10df40ca5e Debugger: Extract virtual function table dumper
Change-Id: I729186d36200967d6ca229e639ceb864f69240f7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-26 11:22:34 +00:00
Eike Ziller
589fedf455 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/projectexplorer/kitinformation.cpp

Change-Id: I94299b069418586db97d1d596a252794e4037556
2016-12-20 17:14:19 +01:00
hjk
ffbe6148e8 Debugger: Inline putStringValueByAddress into its only user
Change-Id: I858f113507ad5712962dc6568e28230ff6dc2916
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-19 10:37:32 +00:00
hjk
fb57391767 Debugger: Make gdbbridge fetchVariable output similar to lldbbridge's
Change-Id: I11fc7d163dbd6b7deb5e88cac65dc61df3352411
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-19 10:37:16 +00:00
hjk
996a697094 Debugger: Fix QObject property extraction in namespaced Qt builds
Bail out on error results as early as possible.

The accessor always exists in libQt5Core, but it can't be found
when using a wrongly mangled name. Use the right one, and add
another sanity check before actually using the function.

Change-Id: I57975be188ca6b03836c0968e59d9603b0eecf27
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-16 09:00:03 +00:00
hjk
0e6c9d26f1 Debugger: Fix pointer arithmetic in dumper framework
Task-number: QTCREATORBUG-17428
Change-Id: I1e3a682a6f412af51e191dc783b89ff266020e3b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-14 14:23:37 +00:00
Orgad Shaneh
05d037a71a Dumper: Re-add Dumper.templateArgument()
Removed in 2244e2b26c. Required for
backward compatibility.

Change-Id: I7255002ad1d6e6b4d04f1fb2a8fa96e3eba65d6b
Reviewed-by: hjk <hjk@qt.io>
2016-12-13 13:26:12 +00:00
hjk
2497f5ea1d Debugger: Remove unused createBitfieldValue function
Change-Id: Ie439d9cd551c33e9c5db6c16e8d221d2c75a7218
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-12-07 10:17:47 +00:00
Christian Stenger
983936f975 Dumper: Fix QObject detection when using procedure linkage tables
Change-Id: I3ac9889b822cb30d2ccdb6a7e2452e753cc3f2df
Reviewed-by: hjk <hjk@qt.io>
2016-12-02 14:44:08 +00:00
hjk
dc2724a3f7 Debugger: Allow QObject property extraction without debug info
Task-number: QTCREATORBUG-16908
Change-Id: I1e1e9d91a6317808610f39868383b67e5c80a9a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-02 13:26:00 +00:00
hjk
2275d68373 Debugger: Switch on QObject name display by default
... and use the option to govern general QObject guts display.

This allows people to completely avoid the performance impact
of attempted QObject display and still makes the feature
more prominent for our favorite use case.

Change-Id: I1e53b6448f646ab7eea9168a3cd24c77769e6328
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-02 11:23:46 +00:00
hjk
2d5e6ef232 Debugger: Fix QObject parent pointer display
Change-Id: If8b6c7415d5cd6b8e5df6c2d760b015e3077c20f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-02 06:57:11 +00:00
hjk
a7fb4cd3ed Debugger: Make QStandardItem dumper work without debug info
Change-Id: Iccdc693616558d2d224c1145eee78f903792c4a6
Task-number: QTCREATORBUG-16908
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-01 14:30:37 +00:00