1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00
Commit graph

14091 commits

Author SHA1 Message Date
Marc-Andre Laperle
c0b26f9993 Bug 568625 - "Invalid arguments" using __underlying_type outside template
ICPPUnaryTypeTransformation was meant to be used only when the
transformation is applied on a dependent type. But it was actually
always used when creating types for decl specifiers, regardless if a
dependent type was involved or not. The untransformed type was causing
issues because code dealing with ITypes doesn't apply the transformation
everywhere. It seems better to apply the transformation early when
possible and let the rest of the logic intact.

Change-Id: I1b6d77a857e901f71f00e935e75d24cea87c3118
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-09 12:06:57 -05:00
Marc-Andre Laperle
4a83dbfbdd Bug 568427 - 'alloca' not resolved when parsing in the context of clang-cl
Don't define __STDC__ for clang-cl, just like msvc. Added a new compiler
type to differentiate clang-cl from clang in order to be able to add the
define just for clang and not clang-cl. I initially thought that the
unresolved symbol was caused by a missing built-in symbol (_alloca) so I
started to implement MSVC as a separate language from GNU and not
pollute GCCBuiltinSymbolProvider with a new concept of compiler type,
etc. But it turns out _alloca is also in declared in the headers and was
inactive because of the wrongly defined __STDC__. So this version of the
fix of adding a compiler type to GPPScannerExtensionConfiguration is
much less intrusive and risky, although adding a new language could have
its merit in case of more substantial change.

Change-Id: Ieb27b7dbcc531b8fd3fe30777cd7f343fd3ba66f
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-08 22:28:19 -05:00
Marc-Andre Laperle
aff9a3332d Bug 568616 - Support for __is_same and __is_same_as (built-in equivalent to std::is_same)
IType.isSameType was doing pretty much already what was needed. Added
GCC 6.0 and 10.0 parser configs to enable these built-ins for the proper
versions.

Change-Id: Ifd2908e726c098fb07c9420b29e2cb26014419bf
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-08 21:04:31 -05:00
Marc-Andre Laperle
c61e879532 Bug 568408 - Add more GCC built-ins symbols in parser (based on GCC 10.2.0)
Add the built-ins that are straightforward to add, according to
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Other-Builtins.html#Other-Builtins

Change-Id: I0d680053018442e6d29a694a7128997b23828d2f
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-11-07 13:57:16 -05:00
Torbjörn Svensson
7f7a310c07 Bug 568079: Warnings as errors
All compile warnings for native code should be handled.

Change-Id: I5ee391fd24339cb55646dbd2980d2856fabe8ddb
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-05 20:24:54 -05:00
Torbjörn Svensson
1d2946184a Bug 568079: Hook into Eclipse tracing system for native code
After loading the spawner library, call the native method
configureNativeTrace() that will query the Eclipse platform for several
debug option strings.

Change-Id: I031bb2cdc04ba2675913b3b2e320039c28139638
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-04 13:37:24 -05:00
Jonah Graham
09b1f93e7e Remove unreachable code
Change-Id: I76fd2ceef7ef000f191b39fcb470cb5d560595a6
2020-11-03 14:33:15 -05:00
Jonah Graham
7e3bb7c9ab Remove unused C Nature from cdt core
There are no C/C++ files in cdt.core.

Change-Id: I1769f630e9bd9aa10397976e56d26c88a7f630dd
2020-11-03 14:29:40 -05:00
Jonah Graham
213088e43a Bug 530194: Don't assume that dwarf headers have valid positions
In cases where the dwarf headers say there is data at a position that
does not exist, the position call throws an exception. Prior to this
patch that exception, being a runtime exception, can cause the whole
IDE to exit in the case that the standalone debugger is used.

Change-Id: I7e12667890490a49ecd63785ea2cc7c02c08679d
2020-11-03 11:05:21 -05:00
Torbjörn Svensson
35530c50ef Bug 568079: Rework spawner to avoid memory leaks on Win32
Change-Id: I1253351d47d52e848867d7f9df61a66f9bd82d41
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:55:05 +01:00
Torbjörn Svensson
c598eedffa Bug 568079: Cleanup of native code
* Unify pointer checkes
* Avoid using negated conditions.
* Reduce scope of local variables when possible

Change-Id: Ibacd13126351019af544f3e22513654d5ffee342
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:33:45 +01:00
Torbjörn Svensson
2857a7a0b3 Bug 568079: Do not require rebuild of natives to enable/disable tracing
Change-Id: I6e26c6febd56bcc23efe0ec65973b2f02a5fd809
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-11-03 08:33:45 +01:00
Torbjörn Svensson
6431307e70 Bug 568079: Reformat source code using clang-format
This will enforce formatting when building the native code

Change-Id: I6c047f4c0672609df322b7ba716fc786f0e3aab4
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:13:42 -04:00
Torbjörn Svensson
7f10dce12f Bug 568079: Remove unneded DllMain (does nothing)
Change-Id: Ib4489c6bcde43c6299550ec57c632bf666bcac6f
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:52 +01:00
Torbjörn Svensson
908aa33b91 Bug 568079: Activate -Wall -pedantic and fix warnings
Change-Id: I7dac7f9d90dd65cfbff241f9b778bc5ff6bc9db6
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
570c5b7ff0 Bug 568079: No need to check for NULL before free()
Change-Id: I4948ce07ed4ec426ce2a3bac226281409c25f7c9
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
3ae7b88630 Bug 568079: Add missing bracers
Change-Id: Icd916d224d4900cf2227f868f8b94cdae13c3f6b
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:44 +01:00
Torbjörn Svensson
82bc0b67e5 Bug 568079: Removed generate method comment from implementation
The comment is part of the generated header file

Change-Id: Ie890ad4d906c0f4e6a23b2a42a1ef342d1da8865
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-31 20:24:35 +01:00
Torbjörn Svensson
c5a53bb7fe Bug 568079: Format C/C++ code
Added a new C/C++ formatter profile called "Unmanaged profile 'CDT'"
(name stolen from the Java formatter) that is basically K&R with the
tweak of maxium line width set to 120 (same width as for .java files).

Added enforcement of the formatter during build.

libspawner.so/jnilib have differences because the re-formatting changes
line numbers and therefore the __LINE__ macro expands to a different
value.

Change-Id: Id3a0619cb31640c7817dc684c72139f90cab0fc6
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-10-24 16:54:40 -04:00
Marc-Andre Laperle
6ca0bb78bb Bug 329995 - Update all C/C++ views when the active configuration changes
Change the default workspace indexer setting

Use the active configuration by default, which is less confusing because
the UI is properly reflected on active config change.  Using a fixed
config can be seen as a more advanced setting for performance concerns.

A new preference is added, only used at default scope:
org.eclipse.cdt.core/cprojectdescription.configRelations
This can be used by products to customize the default according
to their needs (plugin_customization.ini).
This was done because this is a fairly impactful change for users.

Change-Id: I35888ffe5bc1814943f432f88a12094394924c88
Signed-off-by: Alex Freidin <freidin.alex@gmail.com>
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-20 22:59:41 -04:00
Marc-Andre Laperle
cebba80b36 Bug 567822 - [Dark Theme] Several controls using ControlFactory have wrong background (preferences, dialogs)
I don't think "inheriting" by hand the background colors is supposed to
be done like this. Removing the lines setting the background to be the
same as the parent fixes the issue. I also verified all places in the UI
before/after the change.

Change-Id: I2eb4cc5afdd303d5d5613fc3d50d67d0c18c7028
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-19 23:26:17 -04:00
Marc-Andre Laperle
bc76b0a7c3 Bug 567778 - [Include Browser] Cannot open the Include Browser on file outside source folder
CoreModelUtil.findTranslationUnit only returns CElement in the populated
CModel of a project. This shouldn't change as a large majority of client
code need to see the model this way and not consider files that are
outside source folders. So for a file not under a source folder (and
therefore not in the CModel), we can just create a new translation unit
instance for it. This is actually how the editor deals with it too.

Change-Id: I8898822e94cac8562edcc0a726fdd8680119faca
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-12 12:15:43 -04:00
Jonah Graham
a1201a811a Bug 567810: Squash over zealous warning from PDE
See also Bug 558477

Change-Id: I0765a2a49dc77e2f24af787b0f9a1e0e1e510a30
2020-10-12 10:14:26 -04:00
Jonah Graham
c40ed25daa [releng] Update API Filters
Remove old filters that are no longer relevant and mark some API warnings
as ignored.

Change-Id: Id687740b4261f9441f10804941a1d2aa1a3746c8
2020-10-12 10:14:26 -04:00
Jonah Graham
ac86378fe6 Bug 567261: API Filters and documentation for reverted API
Change-Id: I6b58a409dd8ac53f685036445fe517fbb1cdc76a
2020-10-12 08:49:31 -04:00
Marc-Andre Laperle
fa270ed30a [releng] Update plug-in versions
Version changes are all to refect non-API changes (micro version)

Change-Id: I372aa2671a4c7f5c765a42156d3f639b8eaff680
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-06 16:20:18 -04:00
Jonah Graham
24639efcee [releng] Bump version to 10.1.0
Change-Id: I39f7c379c0b43c086a25b047b3af564f6f24d670
2020-10-06 16:20:18 -04:00
Marc-Andre Laperle
41b741f358 Bug 567261 - Revert "541239: [C++17] Implement parser support for deduction guides"
This reverts commit bcb955a321.

Change-Id: Iaf6ba398e439e3d1da1e3a3b0247c7b24bbfb057
2020-10-05 21:40:00 -04:00
Marc-Andre Laperle
a6baac7172 Bug 567377 - Add built-ins for Clang already present in parser for other compilers
These were already there for GCC but not for Clang and they are
supported by Clang:
__is_literal (synonym for __is_literal_type)
__is_standard_layout
__is_trivial
__is_trivially_copyable
__float128
__int128

Change-Id: Iec6151492cd30f17e2a5aa4617f6e88812f0f4cc
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-03 12:42:48 -04:00
Marc-Andre Laperle
90a8376658 Add a comment to help explain one of the mysteries of SetCProjectDescriptionOperation
I'm not sure how sufficient this explanation is but it's better than
leaving just "// Why?" for that central piece of code in CDT.

Change-Id: I0858f83b8f4fbe65fd869e96fb210b5af7d16f65
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-03 10:13:24 -04:00
Marc-Andre Laperle
7a938095be Bug 567336 - Allow double-click on elements in Source Location and Output Location tab
Change-Id: Ifed7b5d005977db30f3c9ba4c7dc6a366691df53
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-02 23:52:52 -04:00
Marc-Andre Laperle
cb8e2c6887 Bug 567536 - In a Perforce workspace, untracked language.settings.xml always get prompted to get latest
IWorkspace.validateEdit should only be called if the file is read only.

Quoting IWorkspace.validateEdit javadoc "A client (such as an editor)
should perform a validateEdit on a file whenever it finds itself in the
following position: (a) the file is marked read-only, and (b) the client
believes it likely (not necessarily certain) that it will modify the
file's contents at some point."

Change-Id: Id73d3629f9ce276b931ed586a6dbf19199d56831
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-10-02 23:41:58 -04:00
Marc-Andre Laperle
cb0797481f Bug 566918 - [C++17] Support for __has_include (standard) and
__has_include_next (extension)

__has_include evaluates whether of the header name passed as parameter
exists. This can only be evaluated as part of a #if directive.
Interestingly, it also has to be reported as defined, i.e. #if
defined(__has_include) or #ifdef. In order to report this as defined,
this implementation adds it as a macro but during macro expansion, it's
actually converted as a dedicated token type. Then this token gets
evaluated during normal preprocessor expression evaluation.

In order to parse header names, there were several options. The main
problem is that header tokens (tQUOTE_HEADER_NAME, tSYSTEM_HEADER_NAME)
are actually produced by the Lexer as part of a special mode
(setInsideIncludeDirective) set during the handling of #include. For
expression evaluation, the tokens are already generated without
setInsideIncludeDirective therefore we only have plain string
and < > tokens.

One approach would be to generate header tokens "earlier" than executing
we need to track a new state while fetching token to configure the Lexer
(setInsideIncludeDirective) when in the context of an __has_include.
There are also complications due to macro expansion within the
__has_include where after one expansion, we don't have a lexer in the
context anymore, introducing more changes.

Another approach would be to remove the Header token creation from the
Lexer itself and let the preprocessor assemble the tokens into an header
string, in both cases of #include and __has_include. This mostly works
and is the approach used in Clang, but the problem is that whereas Clang
keeps track of leading spaces of tokens, CDT doesn't. This means with
such change that CDT would now allow #include <  iostream  > (notice the
white space). I think this is too big of a downside and also too big of
a change to introduce this handling of whitespace at the token level.

The approach used here is more conservative and isolated but also shares
less common logic with #include processing. The non-header token
(string, <, etc) are assembled into a header string only in the case of
a __has_include. So a downside will be that #include and __has_include
will be inconsistent in regards of leading/trailing space parsing but I
feel like this is better than making #include more permissive.

Change-Id: I5b9f5c616c8d999e0c916a85b41f96e20037b651
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-09-27 15:12:52 -04:00
Jonah Graham
65a4d1c424 Bug 546610: fix writeaccess_highlight color in dark theme
Uses same color as JDT in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=537988

Change-Id: I578b6c8e3ebf345d6a90214a3a919e0ee167ac8b
2020-09-07 10:55:00 -04:00
Jonah Graham
545597722a Bug 566713: Fix Widget Disposed exception with asyncExec
Change-Id: I37620534ec5c88da4acaa6e0a2cc789347a8d8d5
2020-09-06 21:47:32 -04:00
Torbjörn Svensson
5249144c8c Bug 521515: Build ppc64le libraries on HIPP
Change-Id: Idd05e27e02b712a0eb6940ebf90a201509140681
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-09-02 20:27:03 -04:00
Jonah Graham
b73f02b4d1 Bug 565836: Include plugin.properties properly for aarch64
Basically a simple typo fix

Change-Id: Id7dea86de6eab4c923da8809e18ae48c507b2732
2020-09-01 07:39:58 -04:00
Jonah Graham
1562080a3c Bug 553674: Make Binary parsers and related classes Autocloseable
And prepare to make it an error in CDT to not have properly handled
an Autocloseable which means a number of fixes to make sure handles
are closed.

Change-Id: I36cd46017bbce6ece1703d688d7754e523eca68f
2020-08-31 21:32:32 -04:00
Jonah Graham
7818f6e494 Bug 558809: Handle cases where Oomph corrupts \0 char in preference
Some CDT preferences use \0 as a separator in preferences. Somewhere
in the Oomph preference synchronizer stack there is, or was, a place
that failed to escape/unescape preferences with encoded \0 properly.

CDT would then fail to parse the preference and an exception would
be raised, causing code completions and the editor to be broken.

This patch hardens the CDT code to:
(1) Allow an escaped \0 to be used as a separator on
    read (Oomph uses ${0x0})
(2) Handle NumberFormatExceptions gracefully. In this case that means
    showing user a pop-up that their completion preferences
    are empty and offering to reset them, or edit them in preference
    page. This UI logic already existed, so all the new code
    has to do on failed parse is return a list of all disabled
    completions.

Change-Id: Ibf3b05c0855bb96c195ca43139a50c27a2a90c7e
2020-08-31 20:06:10 -04:00
Jonah Graham
0cb1f7482a Bug 566511: [releng] Add missing UTF-8 encoding for all CDT projects
Includes updates to code cleanliness script

Change-Id: Ic495124285e3e002993f34dc12be5ad7337fe13b
2020-08-30 20:02:41 -04:00
jantje
4fd6a0f49f bug 560330 remove \${ "to not resolve" functionality
This change  causes incompatibility for users using the \${ to not
expand environment variables.

Tested with sloeber (700+ projects)

Change-Id: If327f055a41c309c475e17e0239a30e7518c3b23
Signed-off-by: jantje <eclipse@baeyens.it>
2020-08-30 16:42:17 -04:00
Torbjörn Svensson
f6016c5e0b Fixed "The value for X attribute is not externalized" warning
Change-Id: Ib2f0d85a0428a1f59cc7ccab6ebb8fd91ffa2a41
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-28 21:32:18 +02:00
Torbjörn Svensson
5779b04e6b Fixed "Key X is not found in localization properties file" warning
Change-Id: I467386ce652c67507c9373a669a60dbb8a8f8e2d
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-28 21:32:18 +02:00
Torbjörn Svensson
1f069898cf Fixed "Build entries must contain at least one value" warning
Change-Id: I47d8b76bc80f863d034044d2a0e4d9e84a335e29
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-28 21:32:18 +02:00
Torbjörn Svensson
8e42cc8b7b Cleanup of PTY class
Change-Id: If04a3ccbc178040d4929767ef1f4c0f1672dfae9
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-28 10:25:08 -04:00
Torbjörn Svensson
07b50ba2a2 Bug 521515: Do not rely on commit date for reproducible builds
As mentioned in
https://devblogs.microsoft.com/oldnewthing/20180103-00/?p=97705,
Microsoft has stopped using the _IMAGE_FILE_HEADER.TimeDateStamp as a
time stamp and rather as a hash of the source files to make the build
result predictable.

Change-Id: I4f4a7b9557330e4c478ef7fb25653144c5b2d4ad
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-27 15:42:44 -04:00
Jeff Johnston
2f05a6348e Bug 565142 - Support using CDT in Eclipse flatpak
- add missing @since tag for new CommandLauncherManager
  checkIfIncludesChanged method

Change-Id: Ic1774a464c08ee86ee594c4d80102457f79b0ea5
2020-08-26 15:46:15 -04:00
Marc-Andre Laperle
b87c2a793d Bug 565553 - Improve performance of build command parsers with large number of files
Do not pretty-format *.language.settings.xml files in the workspace
plugin state area. These are not meant to be shared and looked by users
so they do not really need to be pretty-formatted. This saves a lot of
time for large projects with per-file language settings. For example, I
have seen this save 30 sec on a test project during serialization.

Change-Id: I27f8e0cfdc593f084d95bbed7aedb707570f1f6d
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-08-25 23:11:40 -04:00
Jeff Johnston
05c45c0bae Bug 565142 - Support using CDT in Eclipse flatpak
- modify ProcessFactory to prefix commands with flatpak-spawn
  when running under Eclipse flatpak
- add new FlatpakLaunch class to dsf.gdb to do a prelaunch
  of gdbserver and set up remote port settings when debugging
  local C/C++ application under Eclipse flatpak
- add new tab to gdb when running under Eclipse flatpak
  to allow user to specify gdbserver and port number
- add new org.eclipse.cdt.flatpak.launcher plug-in which
  contains a FlatpakCommandLauncherFactory to handle copying
  header files from host to workspace when developing under
  Eclipse flatpak
- add new FlatpakCommandLauncher class which simply extends
  CommandLauncher and can be used for debugging purposes to
  distinguish from regular command launcher
- also add new FlatpakHeaderPreferencePage to allow C/C++ users
  to delete copied headers if needed
- dynamically add the headers preference page from
FlatpakCommandLaunchFactory
  if running under Eclipse flatpak
- add new ICommandLaunchFactory3 to add an interface to check if
  headers have been modified/removed and scanner info refresh
  is required
- add new org.eclipse.cdt.flatpak.launcher-feature
- give higher priority to ContainerCommandLauncherFactory so if
  running on Eclipse flatpak, the flatpak factory won't be chosen
  if both apply (i.e. building in a container but running on
  Eclipse flatpak)

Change-Id: Id68e60c4dd37c4494af10440231ac7b7bbec8d17
2020-08-25 13:45:33 +03:00
Jonah Graham
0c5093d6ff Bug 566334: Turn on API Tooling & Analysis for all bundles
Change-Id: I3cb5645eba52b0cd0e9a71069264d9c589159107
2020-08-24 17:50:56 -04:00