Skip to content
Success

Changes

Summary

  1. Made PreprocessorMacro and TokenList public (#676) (details)
  2. Invoke "gcc" to build assembler files (details)
  3. Enhance legacy GNU assembler flag detection (details)
  4. Workaround #684 by disabling dsf-gdb tests (#685) (details)
Commit 61c3568839fe2117db0a35b0f484bdd52633a05c by noreply
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.
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CounterMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/UndefinedMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DynamicMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/LineMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ObjectStyleMacro.java
The file was modified core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/PreprocessorMacro.java (diff)
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/DateMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FileMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/FunctionStyleMacro.java
The file was addedcore/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/TimeMacro.java
The file was modified core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/TokenList.java (diff)
Commit 233c6d8696eddb78c2104a91473e933a0c1a88b4 by John Dallaway
Invoke "gcc" to build assembler files

Enables pre-processing of *.S and *.sx source files.
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF (diff)
The file was addedbuild/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GnuAsmFlagsCommandGenerator.java
The file was modified build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/sources.mk (diff)
The file was modified core/org.eclipse.cdt.core/plugin.xml (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/sources.mk (diff)
The file was modified build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java (diff)
Commit dd543580a53c10383f734c2ec50c3031b2a6ab44 by John Dallaway
Enhance legacy GNU assembler flag detection
The file was modified build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GnuAsmFlagsCommandGenerator.java (diff)
The file was modified NewAndNoteworthy/CDT-11.5.md (diff)
The file was addedNewAndNoteworthy/images/CDT-11.5-gnu-as-command.png
Commit e53d4141e696944b15894c9c530d52f3f2e49fb7 by noreply
Workaround #684 by disabling dsf-gdb tests (#685)

This only disables running the tests on Jenkins as the GitHub actions
these tests work fine for now.

See https://github.com/eclipse-cdt/cdt/issues/684
The file was modified Jenkinsfile (diff)