Commit Graph

1642 Commits

Author SHA1 Message Date
Adam Strzelecki
9b3723d6f4 CppTools: Do not highlight instantiation as call
Underlying C++ model sometimes marks C++ object instantiation using initializer
as a (forward) function declaration. This leads to incorrect highlighting of
object variables as if they were function calls.

C++ model however marks in this case (and not any other case) such symbols as
ambiguous function types, see CPlusPlus::Bind::visit. This change skips such
ambiguous functions for highlighting as function call.

Also add test case for related bug report.

Task-number: QTCREATORBUG-15212
Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-16 10:18:05 +00:00
Orgad Shaneh
0bcddcd014 C++: Limit template instantiation depth
A recursive template generates infinite expansions.

Consider the following example:

template <class R1>
struct Base
{
};

template<typename R>
struct Derived :
  Base<
    typename Derived<typename Base<R>::type>::type,
    typename Derived<typename Base<R>::type>::type
  >::type
{};

R is instantiated as Base<R>::type, which causes another
instantiation of R into Base<Base<R>> etc...

This is not a solution, but a workaround.

Task-number: QTCREATORBUG-15141
Change-Id: Ib04f70275e07919e2cb6c7fb61a2045bd52f4a7d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:40:20 +00:00
Orgad Shaneh
3ab5527a83 C++: Produce copyable debug output in CheckSymbols test
Change-Id: I338352eaf6372316d2dc8f0f3ad961b7e8d8cbdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:15:49 +00:00
hjk
0f9e2baa1b Debugger: Adjust QFileInfo dumper for Qt 5.7 on Linux 32 bit
Change-Id: Idb14d81aa3546af0e7a21922fbb6d551ecbc1b06
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:57:37 +00:00
hjk
aa221121b6 Debugger: Pass down expanded inames in LLDB tests
... as well as the 'autoderef' flag. A lot of dumper tests were
failing even though the dumpers themselves were ok.

Change-Id: I198784d95eb0004e81bfab995121e048b1722c66
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:16:17 +00:00
Niels Weber
58804ad823 Fix two typos in comments
Change-Id: Iacb728715b11ca3a9f82d82cca49889eea9dd59b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-11 06:56:08 +00:00
hjk
d6bb579a41 Debugger: Fix QAtomic* and QShared* dumpers with Qt 5.6/C++11
With C++11 we use std::atomic in the ref counter, giving yet
another possibility of structure member names. Instead of
trying to keep up with that, access the binary data directly.

Change-Id: I572f727eb9dab37ac1ca07594d55bea723050817
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 13:49:25 +00:00
Christian Stenger
9ce0c9cd1e Tests: Provide basic boost version check
Change-Id: I38e38fdb129c172cb0056b6f96146a7e29d7288a
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:52 +00:00
Christian Stenger
e7df1233f0 Tests: Provide way to specify boost library include path
Change-Id: I162343f188c5f9c8849d93faf120a424ec41e6f8
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:45 +00:00
Christian Stenger
8cdc648139 Tests: Fix compilation
Change-Id: Ia63f3afd7ae3e76f78ffea31702ba5968b74b418
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 10:11:49 +00:00
hjk
a4a9529403 Debugger: Make boost::container::list autotest pass again
... by adjusting the expectations on the exact type display
and trying two possible versions of structure member names.

Change-Id: I817aeb787b905cb22c6f68856043a29db3e79e59
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 10:08:20 +00:00
hjk
b8a8fe34a2 Introduce a Qt-free JSON implementation
This is essentially QJson with Qt replaced by std:: features.

This is useful to have in circumstances where a Qt dependency
is undesirable, e.g. for the Qt Creator debugger protocol
implementation in our CDB extension.

Change-Id: Iec79c6b23b1e717ce1b6f4d38755287d1f479c13
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-09 08:25:11 +00:00
hjk
e5e3243dd1 Debugger: Fix std::string display for GCC 5.x
Task-number: QTCREATORBUG-15110
Change-Id: Ic1bcdf1b73e0013068e56a5d8804da42cdb2c237
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-06 14:05:07 +00:00
hjk
f58ab8d723 Debugger: Fix std::set<...>::iterator dumper for GCC 5.x and C++11
Change-Id: Icaca7da1f5ae6f958ae0fdaf217bde611d049916
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-06 10:08:48 +00:00
Marco Benelli
30ef3a3afc QmlJs: added a new test case in reformatter test.
Change-Id: I4f6c78cd9d2a2e407ef26e498418617efeee5bba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:15 +00:00
Marco Benelli
b4e42171fd QmlJs: updated .pro file in fileformat test.
Change-Id: I1c6fb32820d8a5e58900c2812f43045bd588aff2
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:04 +00:00
hjk
d5101b5d91 Debugger: Standardize on all-lowercase for protocol options
CamelCase might be more Qt-ish, but the backends tend to use
lowercase only.

Change-Id: I04b9b7305b54226f27b70151115050c4816f911f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:18:50 +00:00
Oswald Buddenhagen
2c000f1cd1 prune ioutils test
this is now extensively tested inside qt itself. maintaining a second
version is unnecessary effort.

Change-Id: I8bbce32b53acad6df37f9c6aea18f791d5648810
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-10-28 13:00:40 +00:00
Davide Pesavento
d3583883a8 Tests: add missing column to tst_fileutils::parentDir testcase
The third column was accidentally removed from one data row in
commit 271794fbc9

Fixes the following fatal error:
QFETCH: Requested testdata 'expectFailMessage' not available, check your _data function.

Change-Id: I4a09df2e044b4dcee1ed2ffc589082a3e2601232
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-10-19 09:00:31 +00:00
Nikolai Kosjar
bc67114d53 Tests: Fix compilation of templateengine.qbs
"Duplicate product name 'StringUtils autotest" - looks like a copy/paste
error from coming from tests/auto/utils/stringutils/stringutils.qbs.

Change-Id: Ibf6088eea4471e6248581a02839a4d8ba9bc73ef
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-10-13 14:04:17 +00:00
Nikolai Kosjar
6b6ad446eb CppTools: Make FollowSymbol respect projects
Finding the class definition for a forward declaration or finding the
function definition from its declaration is mostly determined by the
file iteration order. Documents with the most common path prefix are
checked first.

This works fine as long as the files of your project have a common
ancestor. If that's not the case, FollowSymbol might take you to the
definition within another project.

Fix that issue by considering the project part id when constructing the
file iteration order. Since the cached file iteration order now depends
on the projects, ensure to clear it if projects are added, changed or
removed.

Task-number: QTCREATORBUG-15116
Change-Id: I529166bac363959c9fee0b946747fd0370a88809
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-12 15:08:24 +00:00
Tobias Hunger
95b0dc9120 Utils: Move template file processing from projectexplorer to utils
I want to use it e.g. for snippets and the TextEditor plugin may
not depend on the ProjectExplorer, so the code has to move.

This adds a dependency on QtQml to Utils, but that does not really
matter since that is loaded into QtCreator anyway.

Change-Id: Iada9f40b2966a1fc41631ab33da09812ad67d967
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-12 11:53:01 +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
Claus Steuer
158b07c9c8 C++: Support noexcept operator
The code model failed to parse the noexcept operator which is often
used in noexcept specifiers, e.g.: "void f() noexcept(noexcept(g()));"
Consequently some c++11 headers such as unordered_map, array
and unordered_set could not be parsed and no code completition was
available. I have created the NoExceptOperatorExpressionAST class
which is created whenever a noexcept token is found in an
expression with operator precedence. The noExcept test case
in the cplusplus/cxx11 test now contains a function that
uses the noexcept operator.

Fixed noexcept operator parsing

Added the test requested by Sergey Shambir, which then revealed that
i had not implemeneted the noexpect operator parsing according to the
c++ specification.
As stated here http://cpp0x.centaur.ath.cx/expr.unary.noexcept.html
the noexcept operator is a unary-expression that contains an
expression (and not a constant-expression). This should now be fixed.

Change-Id: Id4a99a43b660bd83e7680274491d99a698b57094
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-03 17:24:45 +00:00
Orgad Shaneh
e68327666f Tests: Fix MSVC warning
tst_timelineselectionrenderpass.cpp:75: warning: C4305: 'return' : truncation from 'double' to 'float'

Change-Id: I2d8e06338bf69c219020e7d9c7015f52db34877a
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-09-28 16:51:47 +00:00
Nikolai Kosjar
8eb30feb03 C++: Add basic tests for raw string literals
Change-Id: I9ca253a6a2296912eafe139ce53f4f9779097248
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-09-23 07:22:01 +00:00
Eike Ziller
054ed354e0 Merge remote-tracking branch 'origin/3.5'
Change-Id: I30148c16cbb66ef670caaf1c74dccff47069bf68
2015-09-15 07:41:02 +02:00
Ulf Hermann
b1dd6c9d75 Timeline: Adapt selection renderer autotest to new material
Change-Id: If518418ba1ee22bff99abe9c108166976ce43f2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-11 09:13:10 +00:00
Ulf Hermann
8d1693e175 Tests: Fix Qt dependency for timeline and qml tests
"declarative" is QtQuick1

Change-Id: Ia72c846dcddc478a7eb0c247345259281fe65d77
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-11 09:13:06 +00:00
Nikolai Kosjar
915f68deac C++: Revert problematic template specialization changes
This mainly reverts

    commit 81721f6781
    C++: Fix resolving of recursive typedef

    commit 2070431d8c
    C++: Fix resolving of partial specialization

and some bits of other changes due to dependencies. It also reverts

    commit e0594fc9b9
    C++: Fix expensive lookup for boost

which attempted to solve the upcoming problems.

Task-number: QTCREATORBUG-14741
Task-number: QTCREATORBUG-14889
Task-number: QTCREATORBUG-14962
Change-Id: I3f9e1f97199e5199b71da394fc27051c7709bd1f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-09-10 12:00:01 +00:00
Eike Ziller
c868b9f3ed Merge remote-tracking branch 'origin/3.5'
Change-Id: Ife5fdcd71b0adc99d4297a28a64515e9e93d7864
2015-09-04 09:19:28 +02:00
Nikolai Kosjar
c504e56d0c C++: Fix MSVC assert in std::isspace()
...when dealing with UTF8 bytes.

std::isspace() expects unsigned char, not char.

Change-Id: I3f9b5e347d79cf94015cc99f8797d5feab406151
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-09-02 10:42:43 +00:00
Nikita Baryshnikov
5398f4f5b1 fix metatype declaration in a few places
Change-Id: I76a12a278db8e74d935e76a5e832daf8e34df2a9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-02 08:48:20 +00:00
Marco Benelli
86bca29f36 Fixed QT variable value in importscheck.pro .
It now use the 'qml' feature instead of the deprecated 'script'

Change-Id: Ie2e4148e586503be11d233b7f544cf4f3c040bdb
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-09-01 14:49:38 +00:00
Eike Ziller
3b1a966cc8 Merge remote-tracking branch 'origin/3.5'
Change-Id: Iebaabfc2f724cd493b7cab025406531cea5cd2dc
2015-09-01 12:57:51 +02:00
Nikolai Kosjar
42d8672626 C++: Add tests
...for two regressions that were introduced by

    commit e0594fc9b9
    C++: Fix expensive lookup for boost

Change-Id: I1fa01e626da480ca53e04b4709fec458378e7aef
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-31 09:26:00 +00:00
Christian Kandeler
ed30c612f4 qbs build: Remove workarounds for fixed qbs bug.
That was most likely QBS-755.

Change-Id: I43d0316113fcca79554bfee9eee9b8bd706fce07
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-08-28 08:13:11 +00:00
Christian Kandeler
6406fd3645 Analyzer: Re-design the diagnostics view.
The old one had a number of problems, mainly due to the awkward
delegate that was used for presenting the data. For instance:
    - Only one diagnostic at a time could be looked at
      in detail.
    - Once it had been opened, it was not possible to close
      such a detailed view again, other than by opening a new one.
We now use a tree view for showing the diagnostics, so users
can show and hide details about as many diagnostics as they
wish. That also gets us sensible item selection capabilities,
so features like suppressing several diagnostics at once can
be implemented in the future.

Change-Id: I840fdbfeca4d936ce600c8f6dde58b2ab93b0d00
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-25 08:42:40 +00:00
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
Orgad Shaneh
bf6e9f0550 Fix tests build with GCC 5
Change-Id: Ia2e0a1c69f73446b45915559294e3348e725ce56
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-18 07:46:22 +00:00
hjk
169a224ec7 Debugger: Use "unused" variables in autotests
Change-Id: I89872cd7792aed5e23331af4ae683dffa3c1291d
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-17 13:51:22 +00:00
hjk
76b5095687 Debugger: Also display subentries for pretty printed char arrays
While the formatted value is usually all that's wanted,
having access to the individual chars is handy at times.

Change-Id: I53b0d0ccfe4289b9b54a1caced4e0bd5ac66d9fc
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 14:18:22 +00:00
hjk
472d584d5d Debugger: Adjust dumper test to changed dumper output
Change-Id: Ib183c960ff7e737636860e007a16972d5f1f232f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-11 10:31:06 +00:00
Andre Hartmann
302eaf0e69 ANSI: Add benchmark
To have an eye on the parsers performance for
further features, fixes and refactorings.

Change-Id: I6e8ebbd098c9b1c9952416bbe0472fe095bd5d7d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-08-05 08:09:55 +00:00
Nikolai Kosjar
892cb154b2 C++: Do not let ASTPath calculate line/column for generated tokens
ASTPath uses TranslationUnit::getPosition(), which returns reasonable
results for:

    1. non-expanded tokens
    2. expanded but not generated tokens

The expanded *and* generated tokens case is not handled since there is
no reasonable mapping from generated tokens to a continuous line/column
information. Consider:

    #define DECLARE_FOO int foo; // Multiple generated tokens
    DECLARE_FOO // ...can be mapped to this line, but to which columns?

Since the result where not valid for the expanded and generated case,
ASTPath took the wrong branches. Avoid this by skipping generated
tokens.

Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563
Task-number: QTCREATORBUG-13386
Task-number: QTCREATORBUG-13390
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-31 11:01:02 +00:00
Christian Kandeler
d489f00f64 Fix qbs build.
Commit d765cd73a2 pulled in more stuff into the diassembler.

Change-Id: I83e0907abaef84a9cebb3c63d957182707af012d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-24 08:04:44 +00:00
Orgad Shaneh
68409fb982 Debugger: Fix tests compilation
Broken by d765cd73a2

QWidget is included in runconfiguration.h, so QT = widgets is required.

Change-Id: I254ae5dca8f537b5d8e3f8977be50cadcaa053b4
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-23 09:36:50 +00:00
Orgad Shaneh
0926d63d56 Sdktool: Only execute tests with -test argument
+ add an autotest that executes it

Change-Id: I7a9e1cd409bccd77776eefb0e832c92c51bc2bd5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-20 08:45:43 +00:00
Andrey Pokrovskiy
9f29762d34 ANSI: Crash in AnsiEscapeCodeHandler::parseText
Qt creator crashes when capturing output from a program that can output
unfinished control sequence. For example: "\x1b".

Task-number: QTCREATORBUG-14720
Change-Id: I7535e509a192685aece63aea79234d88153fcb56
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: wonder.mice <wonder.mice@gmail.com>
2015-07-14 03:42:50 +00:00
hjk
5b583ad67e Debugger: Add dumper for QUuid
Change-Id: I171ac0130009b9610c766deaa2d85aa095e33d6f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-09 06:54:01 +00:00