Commit Graph

4360 Commits

Author SHA1 Message Date
Nikolai Kosjar
602c873d3e CppTools: Reparse editor documents after active project change
Change-Id: I010709c866291bf59c27f4a05765e1ab0efd28af
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:31 +00:00
Nikolai Kosjar
566ab175b3 CppTools: Prioritize project parts from active project
...when selecting one for the editor document.

Change-Id: I85066aaa0862870cb2db2fb2cb40c2b2c23b2cac
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:16 +00:00
Nikolai Kosjar
e691a5e96c Clang: Fix test ProjectFileKindsMatchProjectPartVersion
Change-Id: I9b2470f36ea8f6b5882ac10f28f3a05cbe890801
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:42:58 +00:00
Nikolai Kosjar
ce1c6b2258 CppTools: Extract ProjectPartChooser
...and put it under tests.

Change-Id: Id4bd2391abd1dfdc23640e871453558566cb0693
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:40:23 +00:00
hjk
90a4ff723b Debugger: Remove need for debug builds in some dumper tests
Not needed anymore.

Change-Id: I206c2ae4e93306f8dc4fcea0dab727f769ad739c
Task-number: QTCREATORBUG-16908
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-16 10:17:00 +00:00
Christian Stenger
62118e9d78 Valgrind: Move some memcheck auto tests into plugin
Due to changed dependencies it is nowadays necessary to have more
of the plugin infrastructure at hand. Moving memcheck related tests
to be able to execute them as QC plugin unit test.

Change-Id: Iab492b3cb87728425b950ca9387edf292d895350
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 10:04:56 +00:00
Marco Bubke
1e3f2eec8d Clang: Consolidate all ClangCompilerOptionsBuilder into one implementation
We used the same code in different but don't shared it. From a bug fixing
perspective it's actually not that smart.

Change-Id: Iaaffc883229e259ff77f95b5cf0a8f0d8b5117df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-15 10:18:15 +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
David Schulz
0cadb398a5 Debugger: Add environment variable for cdb extension path
Change-Id: I6d7710ad3f4ba8b9dd32928c06d36191e63e9d3b
Reviewed-by: hjk <hjk@qt.io>
2016-12-14 08:10:16 +00:00
Nikolai Kosjar
02d8e2af1b CppTools: Clean up ProjectInfo
Change-Id: I5d0db45d9fdb624bb6cc55d7f04061d553f13bce
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 09:15:25 +00:00
Nikolai Kosjar
a10bfb8400 CppTools: Do not hardcode default language version
...instead, use the latest we support.

Change-Id: I7e7768bc4bc31de1fe0f441c03f3ab5d677d76e8
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:09 +00:00
Nikolai Kosjar
602ad72d42 CppTools: Refactor ProjectPartBuilder
...and add some basic tests.

Introduce the abstractions ProjectInterface and ToolChainInterface in
order to break the dependency to the ProjectExplorer. Also, some simple
logic can go there to simplify the (Base)ProjectPartBuilder.

Change-Id: I6c50a1804ce62098b87109931eb171f5c2542937
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:04 +00:00
Tim Jenssen
1898ba5ad3 make library defines more consistency
Change-Id: I211d511667d5b9c8f518bfbe750aca4483baff62
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-12 14:48:34 +00:00
Nikolai Kosjar
3a369552c6 CppTools: Classify ambiguous headers depending on other files
This applies for all project managers, except qmake. The qmake project
manager will make use of this in follow up changes.

Before, "foo.h" was always recognized as a CXXHeader. Now, it depends on
the other files. E.g. in a file list {"foo.h", "foo.c"} foo.h is now a
CHeader. In {"foo.h", "foo.c", "bar.cpp"} the file "foo.h" is ambiguous
and we will create two project parts, one where it is a CHeader, the
other where it is a CXXHeader.

Change-Id: I50505163368742584b1380c284d42cbe07cb4fc9
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-12 13:49:09 +00:00
Eike Ziller
c175f1e62f Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/ios/iossimulator.cpp
	src/plugins/projectexplorer/projectwindow.cpp
	src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp
	src/shared/qbs

Change-Id: Ie98e2401a2259903141a13170c78388f2da467d2
2016-12-09 12:42:01 +01:00
Marco Bubke
542c730b33 Clang: Suppress unused parameter warnings in clang headers
Change-Id: I8b2d50be5bda75b6759b7ce73b9d37b2500f3efc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-08 11:57:35 +00:00
Marco Bubke
e0ca3be406 Clang: Fix test
Fix corresponding project file types.

Change-Id: I8758e90a2d0e3cf877b5c4bf72d91fb63f8a7f8b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-07 11:41:08 +00:00
Marco Bubke
3070a28422 Clang: Filter generated files
Generated files are not available, so clang will stop with an fatal error.

Change-Id: I80754015a1daf48cbf2ce8e06526c75b05b2901c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-07 11:41:01 +00:00
Marco Bubke
15de02ea0c Clang: Add refactoring support for unsaved content
We need the generated UI header but we don't have a build directory. So we
provide clang with in memory represations of the file.

Change-Id: Ie9db97bbea2222b0203a0457baa1f1fc7ad97213
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-07 11:39:11 +00:00
Marco Bubke
f02dddb6c8 Clang: Add flag to disable Clang LibTooling
Because of C++ linking problems we introduce QTC_NO_CLANG_LIBTOOLING as a
workaround to disable Clang LibTooling. Use QTC_NO_CLANG_LIBTOOLING=something
to disable it.

Change-Id: I2dc9947d69d94292e08dacb1558bef56f5ebbbe3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-07 11:38:37 +00:00
Christian Stenger
edc55eb7df UnitTest: Fix compile with gcc 4.8
Change-Id: Id620b803bfff7b677d7552c1a7e9aba78e17802f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-07 05:38:46 +00:00
hjk
e351c693c6 Debugger: Add a test to check the automatic expansion of 'this'
Change-Id: I90fad62442d677ba441e2e61b660cae7ebea52ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-06 06:16:08 +00:00
Marco Bubke
b8e391e5f0 Utils: Fix SmallString reserve for read only references
The capacity of a real only reference is zero but the size is larger than
zero. So if we reserve memory the new capacity has to be bigger than the
size and the capacity.

Change-Id: I8b423da7e7c1cf7cee081d1b3f3464b6fb3f67cf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-05 13:59:56 +00:00
Eike Ziller
8f0ddff1cc Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/shared/qbs

Change-Id: I5050baa31f4a892d00cd6f7e088d1b597921474d
2016-12-05 10:55:35 +01: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
87e1093d59 Debugger: Fix QStandardItem test with namespaced Qt
Change-Id: I610dfddd519057c5464d89f42508108c7f8abb14
Reviewed-by: hjk <hjk@qt.io>
2016-12-01 15:28:24 +00:00
Christian Kandeler
6a03705c27 qbs build: Fix one more relative path
Change-Id: If8ad1fd77b3f79a23cb46addf56a91465d530057
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-12-01 14:42:31 +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
hjk
c944d08702 Debugger: Make {boost,std}::shared_ptr display more compact
After debugging through a code base that makes extensive use
of shared pointers (LLDB...) I came to the conclusion that the
display of weak and strong counts is pretty much useless and
it would be better to avoid that level in the display.

Change-Id: Ie03b05fff4f7f5b7dced2e656b404e8e7938cc25
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-01 07:50:23 +00:00
hjk
53022f01fd Debugger: Add dumper for std::once_flag
Change-Id: I8b5166fc0e7d54676b84a1b0d45c6a2793c2a37c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-01 07:09:00 +00:00
Marco Bubke
b888520598 Utils: Reserve in smallstring was flaky
We have to copy the content of SmallString before we instantiate a new
constructor in the same memory. So the content to which data() is pointing
can be already invalid.

Change-Id: I3a0ab4f9ac0c1219c2bd75fc4412eaf56209ca64
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-30 15:32:48 +00:00
Eike Ziller
e487b3bd55 Merge remote-tracking branch 'origin/4.2'
Change-Id: I575f1cf98f2a4740577cdd94da21687d3392cdb7
2016-11-30 15:09:11 +01:00
hjk
3193321532 Debugger: Add a dumper for std::weak_ptr
Change-Id: I253b6d8069ecf36618aa40038da6820f52eb38df
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-30 13:37:46 +00:00
Marco Bubke
99efc96b63 UnitTest: Strip the carriage returns in IsSourceRangeWithText
The source code can be multi line which would contains end lines. Windows
endline contains '\r' which are not present under unix. To unify the test
we simply remove the 'r'.

Change-Id: Icf78b5188c9a4801ec13e455a49a069b20c64e97
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-28 16:48:57 +00:00
Marco Bubke
dca3410ee8 UnitTest: Use the os temp dir instead of a hard coded "/tmp"
Change-Id: Ief32d3ca9aa0ccee25a1415f84552117c7323a31
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-28 16:48:45 +00:00
Marco Bubke
600b85defa Utils: Add carriage return strip method to SmallString
Sometimes you want to compare unix and windows texts in tests. This is a
convenient function to remove the carriage returns.

Change-Id: I164298b70d3d775dd45903ea3753ac0e68ed2fdc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-28 16:48:25 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02:00
Thomas Hartmann
f69a466534 QmlDesigner: Adapt test to api changes
Change-Id: I1340d5a9654f4f757790206fe010004adb6ea236
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-28 11:35:16 +00:00
hjk
eefe4fb7f7 Debugger: Add a dumper test for shared_ptr<ThingWithVTable>
... and fix lldbbridge to pass it.

Change-Id: I2c20cfafe5d7695d4359521cbfcbdc235dacbc82
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-25 11:57:24 +00:00
Kevin Funk
062bf190b8 tst_dumpers: Restore compilation with MSVC
We need to explicitly pass -MD when compiling source files. Unsetting
QMAKE_CXXFLAGS_RELEASE under MSVC strips this flag.

Error:
watchdata.obj : error LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in
debuggerprotocol.obj
watchutils.obj : error LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in
debuggerprotocol.obj
tst_dumpers.obj : error LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in
debuggerprotocol.obj

Follow-up on 0bf4bfcade

Change-Id: I4b63f23c6a0bb6330d30b5ffe894fa0ddcd74cab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-25 09:26:53 +00:00
hjk
5a914b55fc Debugger: Use int instead of bool in test code that can be C
Change-Id: I91fa6e97d4fbffef14a64c2203710923a13d7479
Reviewed-by: hjk <hjk@qt.io>
2016-11-24 17:11:16 +00:00
Marco Bubke
9dfa210011 Clang: Partial fix for highlighting off output arguments
We get the source range for the parameter list and not the arguments
in the initializer list back. So we have to disable the test case.

Task-number: QTCREATORBUG-17101
Change-Id: I65ec6d111766b5728a951b024576cbf777c89728
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-24 16:54:01 +00:00
hjk
99097d011e Debugger: Skip dumper tests automatically depending on build environment
Change-Id: I2df98c283de180f72f2f214637223a7c2f63114c
Reviewed-by: hjk <hjk@qt.io>
2016-11-24 16:25:08 +00:00
hjk
9d7a1fcb0f Debugger: Add a QStandardItem dumper
Change-Id: I503b17e1f36158a774dcf096b19ba628f0cc0205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-24 09:51:40 +00:00
Robert Loehning
800a932e19 QmlDesigner: Fix ambiguous ids in plugin testproject
Change-Id: I05b077f52d643703d0714df99968eb05dfd07dc2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-11-24 09:48:22 +00:00
Marco Bubke
03bbd88eb1 Clang: Fix highlighting of instance with member for writable arguments
struct X
{
  int member;
};


void f(int &argument);

void foo()
{
  X x;

  f(x.member);
}

Task-number: QTCREATORBUG-17101
Change-Id: I6746122dbe86d032b3797a01b5f2257846007f94
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-23 15:22:50 +00:00
Marco Bubke
b196368785 Clang: Add disabled test case for HighlightingMarks
Constructors are not recognized by libClang as callable expressions.

Task-number: QTCREATORBUG-17101
Change-Id: I40eb46c07475e3b2e48bc8117de073732005f8b9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-11-23 14:47:33 +00:00
Tim Jenssen
6fe90532dc Utils: Add offset to search results
Offset are better to compute the length of a text range. The only problem
is that we get them for utf8 because that is the text representation of
source file. QTextDocument is Utf16 based, so it can not binary represent
the source file. Actually I do not see a simple performing workaround for
it.

Change-Id: Id615e1ee6a6e85c6ecc4f8044e275142409d9b46
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-23 12:33:34 +00:00
Tim Jenssen
7f757884c5 Clang: Extend clang query
It's a first step to introduce clang query.

Change-Id: I4d001a8883f56066765ce6bc561fa3f49611c0a4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-23 12:16:04 +00:00
Nikolai Kosjar
c4d9f6ac3f Clang: Fix updating dependencies
...if the registered document comes with unsaved content.

This can easily happen if the document is opened and modified by a
refactoring action.

Task-number: QTCREATORBUG-17295
Change-Id: I3a95fb495b6122248ceaa80985e838851ba2c0e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-23 11:50:44 +00:00