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

14281 commits

Author SHA1 Message Date
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
Jonah Graham
fd9382d8a9 Bug 562494: Update BREE to Java 11
Change-Id: I0c91aafc0cb1b179936acbd4c9df2d961899e3fa
2020-08-24 17:50:56 -04:00
Torbjörn Svensson
e4e1f6780d Bug 565628: Unify line endings for memory block configuration
As the memory browser configuration is preserved in the launch
configuration file as an indented serialized XML string, the string will
contain the result of System.lineSeparator(). As the launch
configuration file can be shared among developers with different
platforms, there is a risk that the launch configuration file is always
modified although there is no real modification, just line endings.
To avoid this scenario, always save the XML string without any
indentation or line endings.

Change-Id: I94497a924f7aa5a881ac6a32f146d2cbceb6324f
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-22 11:33:02 -04:00
Torbjörn Svensson
5a3d2e744b Bug 521515: Also build pty.dll if host is Windows
Change-Id: Idb991b8c641a6fd7a38ef32cce04c63f15f8f57d
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-18 20:16:49 -04:00
jantje
2a62d58621 Bug 564123 Treat environment and build variable case sensitively
Remove all equalIgnoreCase and equal with uppercasing for environment
variables

Change-Id: Ic15974b5fb62413c7b1826ced544ff6d4a8eba2f
Signed-off-by: jantje <eclipse@baeyens.it>
2020-08-18 18:11:48 -04:00
Torbjörn Svensson
09582630d7 Bug 521515: Do not log every failed access attempt
The Windows registry can be checked for keys that may not exist.
In order to avoid logging an exception that the entry is missing when
it's not critical that the entry do exist, the method should just return
null and let the caller handle if it's critical or not that the entry
exists. To easily debug situations where the entry is supposed to always
exist, the trace symbol
"org.eclipse.cdt.core.native/debug/win32/registry" can be set to "true"
and the exceptions will be logged in any case.

Change-Id: I6603cbe363ebecd357fa44c41fb1a26c6345dd70
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-18 14:52:26 -04:00
Jonah Graham
a708a1dcc9 Bug 564123 Remove deprecated PathUtil that has a replacement
Change-Id: Ie2fd4ed201a2bc0c490df9b0deb43cb6d53b1876
2020-08-18 12:33:13 -04:00
Jonah Graham
8c1be591ff Bug 521515: Build pty.dll in docker (fixup)
Fixes for items identified by Torbjörn in my changes to commit
2d03236339

Change-Id: I51f289f731062b4a43bb041d25cd08467014151e
2020-08-18 08:20:12 -04:00
Torbjörn Svensson
2d03236339 Bug 521515: Build pty.dll in docker
Change-Id: I370327489b6c18ac6ba9f36a8da9e94b078ffe1e
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-17 21:42:25 -04:00
Martin Weber
9e303185f9 Bug 564002: Restore the default pattern of the surefire-plugin
Sets the pattern to the default of upcoming tycho 2.0 in advance.

Signed-off-by: Martin Weber <fifteenknots505@gmail.com>
Change-Id: I31b3fc733d0cb888fbf6f566995ce2043f6cd621
2020-08-13 14:18:47 -04:00
Jonah Graham
7120731766 Bug 521515: Generate JNI header files as part of build
Change-Id: Ia92da44f964e1934b2c32d2536f3ec27c03d5d59
2020-08-12 21:30:42 -04:00