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

14446 commits

Author SHA1 Message Date
betamax
3c4287f03d
Make CMakeBuildConfiguration API (#1010)
For ISV integration/extension to CDT CMake, it is necessary to extend
several non-API classes (eg: CMakeBuildConfiguration,
CMakeBuildConfigurationProvider). This would cause "Discouraged access:
The type XXX is not API" warnings.

The classes have now been made API so can be extended without warnings.

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-017
Extending CMakeBuildConfiguration
2025-01-15 11:18:36 -05:00
Jonah Graham
2f55372836
Remove New C and New C++ Project Wizard top-level entry points (#993)
Fixes #965
2025-01-07 10:02:19 -05:00
Jonah Graham
dfdc174b6d Update and refactor Dockerfiles to newer Ubuntu
The docker images all have new, simpler names and use Ubuntu 20.04
(instead of 18.04) as their base.

A few new tools have been added, specifically what is needed for:

- Linux on RISC-V - see #980
- Winodows on ARM - see #969

Fixes #976
2024-12-28 10:48:30 -05:00
Jonah Graham
344d715b83 Allow PTY to not load WinPTY on Windows
Refactors the initialization code of PTY to allow code to avoid
loading WinPTY if it isn't needed. The previous code would
load WinPTY even if ConPTY was in use.

To achieve this the code was refactored to have cleaner state
with a new field ptyType that replaces isConPTY, isWinPTY and
hasPTY.

This is needed so that WoA can run without needing to port the
unneeded WinPTY library. In particular, the winpty.dll and
pty.dll are no longer used on WoA.

Part of #969
2024-12-28 10:48:30 -05:00
Tue Ton
83e52ef18c Add native support for Windows on Arm64 (#971)
- add a new fragment 'org.eclipse.cdt.core.win32.aarch64' containing
re-compiled Arm64 natives suitable for the Windows on Arm64 platform.

- add the 'serial.dll' binary re-compiled for Windows on Arm64.

- add the win32/win32/aarch64 environment triplet to various Maven
build scripts to support building CDT software for that environment.

The updated dlls/exes are not included in this commit and will be provided
in subsequent commits with the corresponding update to build infrastructure

Part of #969
2024-12-28 10:48:30 -05:00
Torbjörn Svensson
27b8da4ecd Classify unrecognized command line options as an error
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-10-19 16:53:52 +02:00
Jonah Graham
e50f81b95b
Bump version to CDT 12.0.0 (#911) 2024-10-08 12:52:15 -04:00
Torbjörn Svensson
9b09dce3a0 __DATE__ should expand with the name of the month in English
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-30 14:03:24 +02:00
Torbjörn Svensson
3b6f1359f0 __DATE__ should have day prefixed with space
The documentation for GCC, and other compilers, stipulates that
__DATE__ with a day of month less than 10 should be prefixed by a space,
not a zero.

Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-30 14:03:24 +02:00
Torbjörn Svensson
54ebddc01c Added missing bracers in native code
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-13 13:32:33 +02:00
John Dallaway
6ffa02911a Allow multiple parserPage XML elements
Eliminates warning on org.eclipse.cdt.ui/plugin.xml
2024-08-07 16:17:02 +01:00
John Dallaway
9e1be512cb Add ELF machine IDs for AVR32, MicroBlaze and V800 2024-07-28 03:45:53 +01:00
Andreas Dangel
3875408070 Speed up closing all file descriptors in the child process (Fixes #835)
_This commit adds to #840 7bd8d52c6c to apply the same fix to
another place that does the same operation on all fds._

When _SC_OPEN_MAX (max nr of open files limit per process) is a very
big number, then closing all possible file handles can take a while.
This change first tries to use the syscall close_range() if available,
falling back to use /proc/self/fd to close only open file handles,
and lastly falling back to the old way of closing all possible handles
one after another.
In general, the first or second approach should be available
which speeds up the pty spawning.

Refs JetBrains/pty4j#147
Copied from 04685d870f
(which is EPL 1.0)

Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
2024-06-27 20:08:16 -04:00
Jonah Graham
24d9bd1834
Correct formatting of C code (#843)
Apply the coding standards to the C code from #840
2024-06-23 14:35:34 -04:00
Jonah Graham
f39fa5596a Bump version of o.e.cdt.core.native 2024-06-23 12:07:26 -04:00
Andreas Dangel
7bd8d52c6c Speed up closing all file descriptors in the child process (Fixes #835)
When _SC_OPEN_MAX (max nr of open files limit per process) is a very
big number, then closing all possible file handles can take a while.
This change first tries to use the syscall close_range() if available,
falling back to use /proc/self/fd to close only open file handles,
and lastly falling back to the old way of closing all possible handles
one after another.
In general, the first or second approach should be available
which speeds up the pty spawning.

Refs JetBrains/pty4j#147
Copied from 04685d870f
(which is EPL 1.0)

Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
2024-06-23 12:07:26 -04:00
betamax
0f36d5dba1
On createBuildConfiguration, reset project's ScannerInfoProvider (#817)
When the project's active IBuildConfiguration has the default name and
the chosen ICBuildConfigurationProvider.getCBuildConfiguration does not
support the IBuildConfiguration.DEFAULT_CONFIG_NAME and returns null,
this can cause the project's ScannerInfoProvider to become "stuck"
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=413357) on the wrong
setting (eg LanguageSettingsScannerInfoProvider instead of
ICBuildConfiguration) until Eclipse is restarted or the project is
closed and reopened. When this happens, the indexer does not function.

This problem may arise if an ISV contributes a
ICBuildConfigurationProvider which has very specific naming conventions
for it's build configurations.

The solution uses the API (resetCachedScannerInfoProvider(project)),
introduced by 413357, to reset the project's ScannerInfoProvider when a
new ICBuildConfiguration is created.
2024-06-12 08:56:47 -04:00
Jonah Graham
7fcfbb0f96
Prepare repo for 11.7.0 development (#813) 2024-06-05 13:19:53 -04:00
G. Hentschke
9f85daf44b
[#808] Support overriden default-editor-association in EditorUtility (#809) 2024-05-31 13:16:03 -04:00
ewaterlander
cd0292a4fc
LLVM optimization remarks. (#803)
Added support for LLVM optimization remarks to the GCC c/c++ error
parser. They were falsly treated as errors (OtherError). Now they are
treated as generic infos. GCC has no diagnostic messages of 'remark'
type. Since GCC and LLVM messages are very similar, no separate LLVM
error parser was created.

Fixes #752
2024-05-29 08:53:59 -04:00
Marc-Andre Laperle
3062cdc8d8
Parse empty __attribute__(()) (#770)
This is accepted by both GCC and Clang and encountered in real code. It looks a
bit strange but basically a condtionally defined macro was used inside the (())
depending on a configurable feature macro of the project.
2024-05-17 12:49:41 -04:00
Jonah Graham
b433dfad02 Update docker image of osxcross to latest requirements.
Building osxcross is somewhat problematic because the versions
are not fixed and reproducibility of making this docker file
can be problematic. For example new versions of cmake, etc
make be needed. TODO Is there a way to fix the version of
osxcross so that we can rebuild reliably?
2024-05-01 12:36:57 -04:00
Jonah Graham
f0ae450f72 Remove use of Thread.stop from test code 2024-04-27 06:18:10 -04:00
Jonah Graham
cc66780e92 Cleanup CDT repo related to the docker + Java 21 updates
- Fix links for cdt-infra
- The cdt-infra git repo is now archived, so this commit updates
the links to the current values.
- Add new Docker related files to the gitattributes as text files
- Update DEFAULT_BUFFER_SIZE for Java 21's value when building JNI,
this also means the dll/exe need a rebuild
- add a toolchains.xml since we use Java 21 toolchain, but most bundles
are Java 17 still
2024-04-26 20:26:40 -04:00
Jonah Graham
381cb7eac5
Refactor MarkOccurrenceTest to JUnit5 style (#730)
This was completed so I could best investigate
https://github.com/eclipse-cdt/cdt/pull/729#issuecomment-1984184372
2024-03-08 11:59:50 -05:00
Jonah Graham
221d346f6d
Prep repo for 11.6.0 (#729) 2024-03-07 14:17:45 -05:00
Dietrich Travkin
95fe4d8701
[#716] Fix varying order of elements in project explorer (#717) 2024-02-26 11:35:53 -05:00
Jonah Graham
207bddab5a
Build with Tycho 4.0.6 (#715)
Includes bundle version bumps for new version of ECJ and
target platform update.

Co-authored-by: Александър Куртаков <akurtakov@gmail.com>
2024-02-22 21:38:57 -05:00
Александър Куртаков
25edc17924 Copyright year bumps 2024-02-21 16:59:16 +02:00
Александър Куртаков
ceb55c49fb Unify maven-compiler-plugin setting
Define the common version in parent pom and don't override it.
Move to latest version while at it.
2024-02-21 16:59:16 +02:00
G. Hentschke
d04849b0c4
[703] fix NPE when no build binaries on system PATH (#704)
[703] fix NPE when no build binaries on system PATH

- fixes NPE when new cmake project has been created while there are no
C/C++ build binaries on the PATH environment variable. The NPE has been
thrown when the children of the project should be fetched (e.g. in
project explorer view)
- fix NPE cause in ErrorBuildConfiguration
- fix unit test

fixes #703
2024-02-11 07:45:57 +01:00
Alexander Fedorov
7f69191296 [#693] Fix resource leak warnings for org.eclipse.cdt.core.utils
* use `try-with-resources` for `AutoCloseable`
2024-02-07 18:24:08 +03:00
John Dallaway
a1a9d93c7e Accommodate external binary object files
- Adorn external binary object icons
- Present symbols under external binary object resources
- Label external binary objects with filename only
- Present absent external binary objects with grey label
- Sort external binary objects by filename only
2024-02-03 04:24:32 +00:00
Marc-Andre Laperle
d5ec9d7c68
Improve ProblemBinding checker message for failed function instantiation (#668)
Display the new more accurate error when all candidates were failed
instantiations. Otherwise, if there is a mix of failed instantiation and
wrong number of arguments, display the old message.
This could really be improved even more...

template<typename T>
void function() {}

Before:
function(); // Invalid arguments 'Candidates are:

After:
function(); // Cannot instantiate template function 'Candidates are:
2024-02-02 11:40:47 -05:00
Marc-Andre Laperle
e838a231d9
Partial fix for bug 574196/530103, error involving sizeof...() (#667)
Also discovered that non-type param is not handled at all.  This case is not
covered in this commit but there is a commented-out failing test for it.
2024-02-02 11:39:16 -05:00
John Dallaway
233c6d8696 Invoke "gcc" to build assembler files
Enables pre-processing of *.S and *.sx source files.
2024-01-24 20:25:19 +00:00
Max Leuthäuser
61c3568839
Made PreprocessorMacro and TokenList public (#676)
### Changes

With this PR, `PreprocessorMacro` and its subclasses are no longer package-private but public instead. Same goes for `TokenList`.

### Reasons for the changes

When parsing C/C++ code with CDT as a standalone library I want to track certain macro expansions using the [MacroExpander](https://github.com/eclipse-cdt/cdt/blob/main/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java).

It is not actually part of the public API but declared as `public`. It takes an argument `macroDictionary` of type `CharArrayMap<PreprocessorMacro>` in its constructor. Currently, `PreprocessorMacro` is package-privat and thus, not available without shadowing (i.e., implementing my custom macro tracker in the package `org.eclipse.cdt.internal.core.parser.scanner`).

It questionable whether it is a good design decision to have public and private API mixed together here (rendering the usage of the constructor of `MacroExpander` impossible).

Also, another problem occurs once you take the route of shadowing to have access to `PreprocessorMacro`: the CDT jars are all signed during release (makes sense) but, sadly speaking, that will result in a `SecurityException` when trying to call their API from your own (unsigned) code which lives in the shadowed package (in my case in `org.eclipse.cdt.internal.core.parser.scanner`).

### Problem solved

MacroExpander can now be used from the outside because `PreprocessorMacro` and `TokenList` are no longer package-private. Shadowing is no longer needed. Signed jars are no longer a problem.
2024-01-18 18:22:40 -05:00
Alexander Fedorov
5e7ce7e31a [#669] Switch from "Require-Bundle:" to "Import-Package:" directive
* Fix MANIFEST.MF for org.eclipse.cdt.core
* Fix MANIFEST.MF for org.eclipse.launchbar.ui.controls
2024-01-05 21:15:21 +03:00
John Dallaway
0e41dfea40 Improve PE64 symbol presentation in Project Explorer
Enhances PE64/COFF symbol presentation for parity with ELF symbol
presentation within Project Explorer.
2024-01-04 16:29:07 +00:00
John Dallaway
0173da5325 Support section data lookup within static libraries 2024-01-02 15:23:27 +00:00
Davin McCall
232b24cd80
[#457] Fix partial specialisation matching for deduced primitive types (#458)
Current partial specialisation selection matches deduced type by
IBinding, not by IType, meaning that it can't work for types (such as
primitive types) that aren't represented by an IBinding. Fix that by
wrapping the result of resolution in a type which can handle either.
2023-12-28 18:07:49 -05:00
Igor V. Kovalenko
f6481742dd Properly persist deduction guide templates in index
Turned out that index is missing information about template parameters of
deduction guide templates, and all affected names which are only available
via index could not be resolved. This happens to e.g. std::map<> which is
usually looked up via index populated from <map> header file.

Fix this by implementing ICPPTemplateParameterOwner and ICPPTemplateDefinition
interfaces in new CPPDeductionGuideTemplate which delegates missing resolution
calls to the function object which already carry required template information.

Closes #438
2023-12-28 17:41:02 -05:00
Igor V. Kovalenko
727430964a Add test for deduction guide template vs index issue
Add new index binding resolution test strategy SinglePDOMReindexedTestStrategy
which does reindex project after adding test case sources. Clean up redundand
C++17 setup helper classes from test since deduction guides are always enabled.

Add test case modelling std::map resolution problem and make sure to run it with
new test strategy to reproduce the issue.

Bug #438
2023-12-28 17:41:02 -05:00
Igor V. Kovalenko
8091626ee4 Allow aggregate initialization in template body 2023-12-28 17:40:41 -05:00
Igor V. Kovalenko
84322c30f4 Amend list-initialization handling of class or aggregate 2023-12-28 17:40:41 -05:00
Igor V. Kovalenko
ae3a0adb81 More tests for list-initialization of class or aggregate 2023-12-28 17:40:41 -05:00
Davin McCall
be3a2eb539
[#455] If constructor arguments fail to resolve, propagate failure (#456)
This change prevents invalid partial specialisations from being chosen
when
instantiating a template in cases where the expression for the
type/value of a template parameter involves a constructor call.
2023-12-28 17:13:35 -05:00
Igor V. Kovalenko
a7bfdd2802
Fix struct declaration introducing name in namespace scope (#587)
When AST is used to resolve binding for class-name and elaborated-type-specifier
is found matching [basic.lookup.elab] rule introducing the class-name, behavior
of CPPSemantics.resolveAmbiguities() is different in presence of index.

If there is no index, CPPVisitor.createBinding() for ICPPASTElaboratedTypeSpecifier
creates binding for class-name as introducing the name. When later lookup finds
this binding all is good because binding is declared before the use site.

If index is available, lookup for class-name fails in AST too but now matching
entry is found in the AST index. When later lookup finds this index binding
CPPSemantics.declaredBefore() returns false because it does not look in
AST index and only checks project index.

To fix this additionally check if ICPPClassType object is in AST index,
as we already do for ICPPConstructor. This way declaredBefore() does almost
the same thing as isReachableFromAst() and lookup succeeds returning the
same binding from index.
2023-12-28 16:41:44 -05:00
Igor V. Kovalenko
4970952382
Recognize simple declaration of function name with function type specifier (#595) 2023-12-28 16:29:40 -05:00
Michael Keppler
d4102ca82f
Clean up Maven build (#662)
* remove invalid tycho resolver config (not valid since many versions)
* fix PMD plugin configuration (config attribute was renamed in 3.18)
* remove duplicate versions already managed in pluginManagement section
* fix indentation
* move all not yet configured versions into pluginManagement of the
parent module to avoid further duplication
* consume the target platform as file, not as maven artifact (this
simplifies building a single module A LOT)
* remove invalid tycho-source-plugin configuration
* disable tycho consumer POM generation (not needed here, and avoids a
warning in each module)
* remove prerequisites. that's for maven plugins only, and this POM
already contains the better suited similar maven enforcer rule
* enforce UTF-8 for javadoc generation (the build fails on Windows
otherwise, trying to read some Japanese? characters with the Windows
default encoding)
2023-12-28 14:35:58 -05:00