Commit Graph

2420 Commits

Author SHA1 Message Date
Christian Kandeler
dc66d30076 CPlusPlus: Support C++11 attributes also for function parameters
Fixes: QTCREATORBUG-24636
Change-Id: I9dc3d2cc6ca102b09f6b040455fa901c362dae7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-12 13:16:34 +00:00
Christian Kandeler
59f8bd4702 CPlusPlus: Expose "static" specifier also for function declarations
To be able to do this, the parser needs to store the decl specifier list
in FunctionDeclaratorAST objects, the same way it is done for
FunctionDefinitionAST.

Task-number: QTCREATORBUG-24894
Change-Id: I475fb08b1f14c63f3050d72dff200c1b08df5789
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-11 15:41:27 +00:00
Eike Ziller
1d2b5db02f Merge remote-tracking branch 'origin/4.14'
Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
2020-11-10 13:42:46 +01:00
Christian Kandeler
e41f3eb607 CPlusPlus: Fix "find usages" categorization for sizeof and array access
Task-number: QTCREATORBUG-24894
Change-Id: I65fa097785b19e181f15178ad6d30608899316c0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-09 12:50:07 +00:00
Christian Kandeler
882dd60aad C++: Extend alias declaration support in built-in parser
The type-id in an alias declaration can also define a new type.

Change-Id: I65dc397d2526c56334676c6ab522564f6748d594
Task-number: QTCREATORBUG-24875
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 10:56:17 +00:00
Christian Kandeler
42d34015e2 CPlusPlus: Provide information about the "static" specifier
... to the function type.
This fixes the issue for function *definitions*. For function
*declarations*, we need to amend the parser.

Task-number: QTCREATORBUG-24894
Change-Id: I02043d8b974c2c64dcd739c7e05ce44fd277b5d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 10:55:38 +00:00
Christian Kandeler
1988d89198 CPlusPlus: Check for static member functions in FindUsages
Static member functions cannot modify the object and therefore must not
be reported as writable references.
Note that this does not have an effect yet, as the function type lacks
information about the "static" specifier.

Task-number: QTCREATORBUG-24894
Change-Id: Ib04a17864a0ca5b7610579a2f5efbcfde257e08a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 09:51:08 +00:00
Christian Stenger
f2b5c29494 Tests: Fix linking of test project
Avoid fail to link when using Qt5.15.1 and MSVC 2017.

Change-Id: Ief4edce7490c4828c46033c7a055acb6173c94e1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-06 05:22:02 +00:00
Christian Kandeler
de1e12f3af CPlusPlus: Correctly categorize post-increment and -decrement accesses
Change-Id: Id21c13ea58f6747c226d91aff2b00c3409faa880
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:24:33 +00:00
Christian Kandeler
a88266798f CPlusPlus: Differentiate declarations with an initializer
... from those without one, and display the former like write accesses.

Task-number: QTCREATORBUG-24894
Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:02:52 +00:00
Christian Kandeler
cf6757406d CPlusPlus: Properly categorize usages in if statements
Change-Id: I5f6e5fa14ea51cd9e61a9e2e96c110ca618be429
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:02:34 +00:00
Christian Kandeler
89644e4a06 CPlusPlus: Properly categorize usages in switch and case statements
Change-Id: Iafbbdcca23db38d82bbc5bb24a39dac2a6d0a764
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-02 16:03:28 +00:00
Thomas Hartmann
9496732db5 QmlDesigner: Fix and cleanup tests
Change-Id: Id26c3447025744619e9bc80da202aaa49be9567b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-02 13:17:36 +00:00
Eike Ziller
d54f7b0eb2 Fix building tests with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I192245125f04f8350597bbe481d80d3f8ba0cae0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-30 15:15:25 +00:00
Christian Kandeler
8d8473daf6 Debugger: Fix compiler warning in dumper test
Change-Id: I9f3633065890bb5e574fd688b39b0bc93a94c8b1
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-23 07:22:50 +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
Christian Kandeler
b58ca33ff6 CppTools: Categorize the delete operator as a write access
... in the "Find Usages" results.

Change-Id: Ib399bf762c717b7d4439be26b9180574aefce7e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-21 09:12:33 +00:00
Cristian Adam
a2aa02acba CMake Build: Make sure testplugin target exists before setting property
When doing a minimal build, the testplugin might not be created.

Change-Id: Ia4f1cbd14cbdad6e81cb7090a7f52aad692175fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-20 14:12:38 +00:00
Christian Stenger
05ecdba5d8 Tests: Fix compile and code
Change-Id: I2f2a8a4ff9e7bcd3138b93b177e07f2aa3850fcb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-10-20 07:35:33 +00:00
David Schulz
cf460578ff Debugger: fix various dumper tests for mingw
since the gdb uses to hang on windows when calling functions we disabled
that functionality reflect that in the QDateTime and QLocale tests.

Change-Id: Ie212ab8c7634804e1054bfddfb753de055403c4f
Reviewed-by: hjk <hjk@qt.io>
2020-10-08 10:36:56 +00:00
Christian Stenger
05254bef15 Tests: Ensure valid project file
Change-Id: Iad22782fee5b330d145ab456c38ff0b9363f0fd2
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-07 12:42:22 +00:00
David Schulz
73725f409a Debugger: set utf8_source qmake config value for cdb
fixes cbor test and simplifies char array test

Change-Id: I035e393e0e09dc8a16e27dd400a7557d3cf3a006
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-07 12:42:12 +00:00
hjk
45ca2e2924 Debugger: Simplify QString dumper test
Change-Id: I53267960155055219c7396eeaee0312602f7011d
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-07 09:05:55 +00:00
Eike Ziller
2092ebd074 Merge remote-tracking branch 'origin/4.14' into master
Change-Id: I4ea98cc1c14808afe44030a057f9ff289a57ccfe
2020-10-06 10:05:47 +02: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 Stenger
35ffc930b8 Tests: Fix QJson dumper test
Change-Id: Ic9f5b7da358164bb9b66f2c75965377cdbf09c4e
Reviewed-by: hjk <hjk@qt.io>
2020-10-05 11:18:45 +00:00
Christian Stenger
bf19509642 Tests: Fix boost pro file additions
Otherwise we might end up with a messed up project
file.

Change-Id: I432d45063092d0a5dead3ef975ba3ce5294c1af0
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-05 10:02:14 +00:00
David Schulz
000f1bb338 Debugger: Fix char pointer dumper test for cdb
Change-Id: I3a1bf50a32076199791283d4bb661feb72c85f6d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-01 07:00:48 +00:00
hjk
950aa580ab Debugger: Make QList test pass with Qt6
QStringList is a typedef now

Task-number: QTCREATORBUG-24098
Change-Id: I0f12655a9b86e4813245fbb08cc0a1c3e21d2dcf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-25 14:17:40 +00:00
hjk
60c4dfb5e5 Debugger: Fix QString dumper test for Qt 6
QStringRef gone etc.

Task-number: QTCREATORBUG-24098
Change-Id: I416f274bccc19c73e226dbf809729c3b72b565a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-25 13:05:13 +00:00
Michael Weghorn
0ab97e1159 Debugger: Show actual type for 'gchar *' elements etc
When 'char *' typedefs (and the like) are used, this makes
the actual (i.e. the typedef's) type name shown instead of the
one that the type is a typedef for.
For example, 'gchar' is shown as type for all elements of a 'gchar*'
when expanding that one in the debugger's locals or expressions view.

Original display of text representation for 'char *' typedefs etc.
had been added with commit 70c4889ac9
("Debugger: Show text representation for 'char *' typedefs etc",
2020-06-26). Move the typedef resolution one level down so the
original type name is still available for display.

This also extends the existing 'gchar *' test case accordingly.

Change-Id: I9558360b3bf96906d6dc39a63706bb8ce28c2f1c
Reviewed-by: hjk <hjk@qt.io>
2020-09-24 14:31:43 +00:00
Michael Weghorn
37ebbeb3a0 Debugger: Extend Bitfields test for GDB case
* add bitfield case for char as well
* add tests for expressions view

Task-number: QTCREATORBUG-24693
Change-Id: I716dcd0eae3002401c891b733440ea2c6acb32ff
Reviewed-by: hjk <hjk@qt.io>
2020-09-24 13:11:56 +00:00
Christian Kandeler
f244a7ea4c CPlusPlus: Consider member initializations
... when checking usage types.

Change-Id: Ic875f3bcae9cf045dbb062670e8cf941de533404
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-18 11:01:47 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Christian Kandeler
ee8e102cbc CPlusPlus: Look at all overloads
... when trying to find out the usage type of a function argument.
Otherwise, we potentially ignore functions which have additional
overloads with a shorter parameter list than is required for the call.

Change-Id: I02bf2cb359ea9d506e2644388234dc28fa072445
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-15 09:23:48 +00:00
hjk
a50f1baf5d Debugger: Change LLDB value creation hack
... to something that works with LLDB 12.

Task-number: QTCREATORBUG-24596
Change-Id: Ib2f8255d45a02fa3d2c737864994397f587e9b15
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-15 08:45:32 +00:00
Christian Kandeler
45dd074441 CPlusPlus: Categorize "Find Usages" results
That is, find out whether a certain access was a read, a write, a
declaration or something else, and report the result to upper layers.
Follow-up patches can make this information visible to users.

Task-number: QTCREATORBUG-12734
Task-number: QTCREATORBUG-19373
Change-Id: Iee79e39dd1eb5a986a7e27846991e0e01b2c3a2f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-03 14:32:47 +00:00
Christian Kandeler
1652396ece CppTools: Fix CppSelectionChanger autotest
... on Windows.
We need to open the test file in text mode. Otherwise the raw string
literal will contain carriage returns. As these get dropped by
QTextDocument, the offsets will be inconsistent with the ones reported by
the tokens, causing the test to fail.

Change-Id: I161a3f5791c33416ff732f90fd615cf39d8152ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-31 09:15:50 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
Christian Stenger
e9c27cca34 Utils: Fix persisting of QRect
And pass explicitly a QVariant to the writer to avoid
unexpected behavior when trying to store the geometry
of a widget.
This resulted in a warning for any session where the
user had used the debugger at least once.

Change-Id: I5cb2352ab29ff7d2a64c84ffcdf040efe6d04b94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-08-19 07:39:43 +00:00
Eike Ziller
0c4135e380 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp

Change-Id: Id624bad384050d567efba0700046331086cb12dd
2020-08-13 13:28:33 +02:00
Eike Ziller
f296ed1328 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I1c426d95eedd82bd4470a64a9bafd734d23081ac
2020-08-13 11:41:32 +02:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Christian Kandeler
0615d0ec06 CPlusPlus: Fix expectations in preprocessor autotest
... regarding unfinished macro calls.
Amends df0ffd8bb8.

Change-Id: Ia7b8752860ac9207e702697cbee87f16a39dd1dd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-12 08:21:32 +00:00
Christian Kandeler
868236886a Utils::Environment: Extend autotest
... to cover the diff/apply mechanism.

Change-Id: I7d9e794792d6730e935c99c66062ea417dc65fe7
Reviewed-by: hjk <hjk@qt.io>
2020-08-11 12:13:23 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Marco Bubke
e43c7fdb1d QmlDesigner: Split messaging and process for puppets
This will make it easier to implement custom puppets. The new connection
manager will restucture the code and it add a mechanism to capture data
too.

Task-number: QDS-2529
Change-Id: I5d15c3303ef1c9a3e25ba197d350e0d561ce813a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 12:53:30 +00:00
Christian Stenger
84e4b3af31 Tests: Do not fail if boost compile fails
Change-Id: Iaa74f0c5911f328ca041a8f8e84c760187f6c38f
Reviewed-by: hjk <hjk@qt.io>
2020-08-10 10:55:16 +00:00
Christian Stenger
326cf1a982 Tests: Fix compile
Amends 52b2ca55c9.

Change-Id: I82b2ae8a353fc6ebe46e38956100fd3dce53fdf6
Reviewed-by: hjk <hjk@qt.io>
2020-08-10 08:48:24 +00:00
hjk
52b2ca55c9 Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
QT_USE_FAST_CONCATENATION doesn't do anything nowadays.

Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS
for QStrings and enables more QStringBuilder use for QByteArrays.

Change-Id: Ibd297817c50d86661d47822799f989447249af1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-07 12:45:03 +00:00