1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Commit graph

14412 commits

Author SHA1 Message Date
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
Marc-Andre Laperle
533125c6d4
Support for __is_function Clang/GCC built-in (#654)
I don't remember exactly which code didn't parse for me initially
(probably MSVC), but I've found this in some std::is_function
(type_traits) implementation:
 #ifdef __clang__
__is_function(_Tp)
...

This is a missing built-in in CDT.
2023-12-27 16:49:05 -05:00
Marc-Andre Laperle
8d24554856
Fix a case of variable template instance not resolved (#655)
When the variable template was instantiated through an implicit name
(constructor), the current look-up point was used to determine whether
or not the variable instance was an explicit specialization but it's not
enough. During resolution of implicit name, the look-up was on the
constructor call, not on the variable instance. I'm not sure if the
current look-up should be changed but we already had the information
about the AST node being an explicit specialization down the stack, so
we just pass that info now and it seems safer than changing the look-up
point.
2023-12-27 16:44:53 -05:00
John Dallaway
c37626a3d1 Provide helper class for PE64 objects
This class is intended to mirror the capabilities of the ElfHelper class
over time. Initial support allows for correct presentation of section
sizes within the Eclipse Properties view when a PE64 object file is
selected.
2023-12-22 11:55:51 +00:00
John Dallaway
dde763ac0c Support PE file inspection within static libraries 2023-12-19 15:56:52 +00:00
John Dallaway
9aa6fb158d Use build CWD for object path processing within GNU archive files 2023-12-12 20:30:10 +00:00
Jonah Graham
f7a63377a6
Prepare repo for 11.5.0 (#633) 2023-12-06 18:48:15 -05:00
John Dallaway
8e5004827e Provide viewer filter for absent C/C++ translation unit files 2023-10-20 16:38:05 +01:00
John Dallaway
6e3d2da301 Do not handle absent external translation units 2023-10-14 12:46:41 +01:00
John Dallaway
4036cd3084 Decorate absent external translation units 2023-10-12 17:54:35 +01:00
John Dallaway
e1a8c4683a Sort external translation units by name 2023-10-11 08:47:52 +01:00
John Dallaway
5c73848e2a Adorn images for external translation unit elements 2023-09-26 22:40:52 +01:00
John Dallaway
8ca56de402 Detect MSYS2 UCRT64 toolchains 2023-09-25 16:02:05 +01:00
William Riley
5250f5a07b
Replace org.freemarker with org.freemarker.freemarker (#547)
Also remove re-exports & add package imports

Fixes #546
2023-09-19 14:02:39 -04:00
ewaterlander
147332763b
Swapped arguments (#552)
Fixed swapped arguments in call of new ExtendedScannerInfo().
2023-09-15 17:28:31 -04:00
Jonah Graham
48804f5ed9
Mark unused API for deletion (#559)
Fixes #558
2023-09-15 17:27:33 -04:00
Jonah Graham
a92b90a4c8 Bump all bundles that are missing BREE in 11.3.0
Part of #551
2023-09-15 07:24:17 -04:00
Jonah Graham
3bcba2303d Prepare repo for CDT 11.4.0 development
Part of #548
2023-09-14 19:47:15 -04:00
Torbjorn-Svensson
1b2472faff
Ignore lines with "in function" and "In function" (#534)
In recent binutils version, the warning, for stubbed functions, is
properly printed and due to this correction, linking a project with
stubbed functions fails the build in headless build rather than
just printing the warnings.

Example:
.../arm-none-eabi/bin/ld.exe: .../libc.a(libc_a-writer.o): in function `_write_r':
(.text._write_r+0x10): warning: _write is not implemented and will always fail
...
12:02:52 Build Failed. 8 errors, 8 warnings. (took 6s.284ms)

The first line matches the error pattern (.*[/\\])?ld(\.exe)?: (.*)
that incorectly fails the build in headless mode (a single line matching
a pattern with severity "error" fails the build) when there are really
only warnings in the build log.

The problem can be obsered using the GCC 11 (and later) toolchain
builds with newlib for the arm-none-eabi target provided by Arm.

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2023-09-01 11:25:45 -04:00
Jonah Graham
c7169b3186 Refactor XML file handling 2023-08-16 11:06:59 -04:00
Jonah Graham
220ba610d0 Fixup some API version errors
Follow up for #491
2023-08-15 20:00:56 -04:00
Jonah Graham
72c8186f50 Fix NPE when language entry is incomplete (as it is for LLVM) 2023-08-11 14:33:36 -04:00
Jeff Johnston
dd4a40a683
Fix meson build under Docker Tooling (#491)
* Fix meson build under Docker Tooling

- add new IToolChainConstants containing SECCOMP_UNCONFINED property constant
- add new setLauncher() method to CBuildConfiguration so that
  watchProcess() can be used for container building
- enhance ContainerCommandLauncher to discover specification of
  SECCOMP_UNDEFINED boolean option for execute() so "seccomp=undefined" can be specified
- fix ContainerCommandLauncherFactory.verifyIncludePaths() to only
  look at filtered includes that have been made absolute and to
  recognize matches when the prefix shows up in the loaded list
- add setting a property to ContainerGCCToolChain to set SECCOMP_UNCONFINED to true
  by default for the time-being
- when generating scannerinfo, specify "seccomp=unconfined"
- in ContainerGCCToolChain.startBuildProcess() remove extraneous
  banner statement and ensure that the build directory is created
- fixes #479
2023-08-10 16:36:05 -04:00
Gesa Hentschke
c2d0a6600b
[#484] Add extension point for custom icons of C/C++ source files (#485)
* [#484] Add extension point for custom icons of C/C++ source files

fixes #484
2023-08-03 17:42:23 +02:00
Jonah Graham
ac84c4ec86 Prepare repo for CDT 11.3.0 development
Some bundles are bumped because dev happened between 11.2 release and
this version bump. The most significant change that happened
was the bump in Tycho version which changed ECJ version and
hence some class files changed

Part of #420
2023-07-10 21:41:39 -04:00
John Dallaway
5be8661c9b Support DWARF v5 content form data 2023-07-07 21:07:17 +01:00
John Dallaway
54d5e1445c Support DWARF attribute form DW_FORM_implicit_const 2023-07-03 14:05:43 +01:00
ewaterlander
8a8b94bfbb
Postpone build container creation to build start. Fixes possible Eclipse freeze. (#433)
The creation of the build container for Core Build projects is
postponed to the start of the build process.

StandardBuildConfiguration getBuildContainer and setBuildContainer
have been cleaned up.

CBuildConfiguration creation is started via
CBuildConfigurationManager.getBuildConfiguration(IBuildConfiguration)
which holds a lock on the HashMap 'configs'. Creation of
StandardBuildConfiguration triggered, via applyProperties and
getBuildContainer(), a Folder.create which loops back to
CBuildConfigurationManager.getBuildConfiguration().
For detailed traces see https://github.com/eclipse-cdt/cdt/issues/424

Fixes #424
2023-06-26 13:37:23 -04:00
John Dallaway
44dc9d7cd7 Propagate exceptions in default binary file viewer 2023-06-26 18:30:53 +01:00
John Dallaway
9edc432c49 Eliminate memory leak in Default Binary File Editor 2023-06-17 06:07:53 +01:00
15knots
09728af3db
recognize source file extensions ".ccm", ".cxxm", and ".c++m" (#422)
* recognize source file extensions ".ccm", ".cxxm", and ".c++m"

cmake 3.27 release notes: The "CXX" language now treats source file
extensions ".ccm", ".cxxm", and ".c++m" as C++.

Signed-off-by: 15knots <11367029+15knots@users.noreply.github.com>
2023-06-16 20:56:51 +02:00
John Dallaway
74bcb42202 Provide hex dump of binary files in Default Binary File Editor 2023-06-13 17:17:17 +01:00
John Dallaway
d4c444eaeb Accommodate archive files in Default Binary File Editor 2023-06-12 15:50:37 +01:00
John Dallaway
0a8734fb12 Use PE64 class for machine type validation 2023-06-10 05:50:02 +01:00
John Dallaway
c91d0f7d4a Process ELF files without file suffix as binary content 2023-06-09 13:01:53 +01:00