1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00
Commit graph

14474 commits

Author SHA1 Message Date
John Dallaway
e112fc24b9 Accommodate Mach-O LC_RPATH load command 2025-06-30 17:25:59 +01:00
ewaterlander
591e99e68b
Build not configured correctly (#1201)
Under some circumstances it can happen that a BuildConfiguration is
registered in the CBuildConfigurationManger as both a valid and
invalid ICBuildConfiguration counterpart. This results in a "Build not
configured correctly" error when trying to build a CoreBuild project.
This change removes valid build configurations from the invalid list
before looking for the counterpart.

Fixes #1193
2025-06-26 11:44:26 +01:00
Tue Ton
f7d137102b
Add Terminal's native fragment for Linux riscv64 (#1210)
- add a new fragment 'org.eclipse.cdt.core.linux.riscv64' containing
compiled riscv64 natives suitable for the Linux riscv64
platform.

- add the 'libserial.so' binary compiled for
Linux riscv64, for the serial communication interface.

- add the linux/gtk/riscv64 environment triplet to various Maven
build scripts to support building CDT software for that environment.

Fixes #980
2025-06-20 14:41:55 -04:00
John Dallaway
f591672014 Extend Mach-O load command support
We skip load commands that are not processed by the symbol loader and
log commands that are not recognized.
2025-06-17 05:37:15 +01:00
Raghunandana
5b76b3e24f
Workbench viewer limit is setup for 'C/C++ Projects' view. (#1181)
C/C++ Projects view makes eclipse unresponsive if it has more than 70k
files in a directory inside a cpp project. So we can set up viewr limit
for the JFace viewer.

see https://github.com/eclipse-cdt/cdt/issues/1180
2025-06-09 16:07:24 -04:00
Jonah Graham
2ba5b3d68a
[releng] Prepare repo for 12.2 development (#1185) 2025-06-09 15:31:36 -04:00
Jonah Graham
abe4d1b8e1
Adapt compare control to CompareConfiguration (#1173)
This is to accomodate a bug fix done in Eclipse Platform in
https://github.com/eclipse-platform/eclipse.platform.ui/pull/2629

Fixes https://github.com/eclipse-cdt/cdt/issues/1172
2025-05-28 18:54:00 -04:00
Jonah Graham
9b6fded373 Explicitly use Platform's M3 I-build
Since M3 was published, platform had upped version
of org.eclipse.core.runtime.

See https://github.com/eclipse-cdt/cdt/pull/1165#issuecomment-2892408192
2025-05-19 20:54:39 -04:00
Jonah Graham
8687aec665 [releng] Require target platform bundles as minimum version
Using:

```
mvn org.eclipse.tycho.extras:tycho-version-bump-plugin:4.0.12:update-manifest
```

and then multiple iterations to bump the bundle-version:

```
mvn verify org.eclipse.tycho:tycho-versions-plugin:4.0.12:bump-versions -Dtycho.bump-versions.increment=100 -DskipDoc=true         -DskipTests=true         -P baseline-compare-and-replace -fae -Djgit.dirtyWorkingTree-cdtDefault=warning
```

Make sure bounds of all dependencies match what we built against. This
prevents issues such as Bug 536448 from recurring. In 2025-06 there
are a number of Eclipse Platform changes that make CDT susceptible
to these types of issues again.

Note that this change is similar to previous iterations, such
as 1087dc5f22, but with the automatation
we can now apply this to *all* bundles.

In addition, with the tighter version constraints, building from
simrel repo for the jniheader (releng/scripts/do_rebuild_natives.sh)
is no longer sufficient. This speedup has been removed as it was probably
incorrect to have by default.

The api filters were introduced because some bundles are re-exported. Those
re-exported bundle requirements mean that technically we need to bump
the version, but in reality we effectively required the range as now
documented anyway, so doing a major version bump is unneeded.
2025-05-19 14:28:08 -04:00
Jonah Graham
7fa83d2902 Use latest Eclipse Platform and all dependencies for CDT 12.1
Includes removal of references to Platform internals that have been
changed.

Note the removal of setHoverImageDescriptor matches the change
made to platform in
be4a4aab48 (diff-6b07181bf8beb80046741858e13f5721f608136e00ce17749b5fa6d550cece9b)
2025-05-19 14:28:08 -04:00
John Dallaway
0f47c669c1 Improve MinGW detection for toolchain availability filtering
Use the same logic to locate a MinGW toolchain when filtering toolchains
for selection in the project wizard as we do during project build.
2025-05-07 20:11:05 +01:00
John Dallaway
6c53fd8bc3 Support DWARF attribute form DW_FORM_strx1 2025-05-07 15:12:59 +01:00
Jonah Graham
4f39107b14
Prepare repo for CDT 12.1.0 (#1107)
Includes building with Tycho 4.0.12
2025-05-06 16:16:40 -04:00
Christoph Läubrich
af359a7bba
Add accessor for included pty instance (#1109)
Currently if I get passed a Process from by a method call I can check it
for the Spawner and can already call special methods like hangup(). But
there is no way to get access the the PTY used to create the Spawner so
for example one can't call PTY#setTerminalSize or query any other
properties.

This now adds a new method pty() that returns this instance for further
investigation and actions.
2025-04-23 14:06:32 -04:00
Jonah Graham
74c4844357
Avoid null value being converted to "null" string in environment (#1096)
If the CDT Variable is APPEND or PREPEND, and the incoming environment
did not contain that variable name, the resulting environment would
have null.

For example, if PATH was not set on the incoming environment, and
PATH was supposed to be prepended with /usr/bin, this method
would have set PATH=/usr/bin:null

This change ensures that the delimeter + null are not prended/appended
when the incoming value is null.
2025-02-25 21:55:40 -05:00
John Dallaway
5135c9fc85 Improve MinGW installation detection
- Look for clang, gcc or clangd
- Re-order search for MSYS2 MinGW subsystems
- Add clang installation info and notes to 'Before you begin' page
2025-02-23 17:14:35 +00:00
Jonah Graham
654e270767 Clarify API around CBuildConfiguration.getBuildDirectory as @nooverride 2025-02-19 21:03:55 -05:00
Jonah Graham
0e5338966d
Add a directory tracker to the CBS Makefile builder (#1071)
Messages such as "make: Entering directory" are now processed so
that the scanner info builder knows the correct full path to use
for build.

Without this code calls to ToolChain.getResourcesFromCommand() would
pass in the wrong directory and resources could not be reliably
calculated. With the incorrect calculation the scanner info does
not get applied to the file correctly and the file cannot be indexed
reliably.
2025-02-19 21:02:38 -05:00
Jonah Graham
3fc221a349
Use CommandLineUtil to split and join command lines in CBS Makefile support (#1073)
Without this the build and clean command entered in the CBS
settings could be parsed and re-assembled incorrectly.

A simple example is that an extra space (e.g. "make  clean") would
lead to an error when running make like:

```
make: *** empty string invalid as file name.  Stop.
```

This happened because the code used trivial split on " " and join
with " " to handle parsing that command line string into array of
arguments. This change fixes that by using the functionality already
available in CommandLineUtil

Fixes #1072
2025-02-19 21:02:01 -05:00
Jonah Graham
7cb2d69be9
Improve CommandLineUtil to string methods so they look prettier (#1074)
Initially CommandLineUtil.argumentsToString was used to provide properly
quoted string when interacting with GDB. But it is also useful to
print a string that can be copied + pasted to a terminal for the user.

When doing this the always quote every argument looks less nice, so
this change updates the code to only quote argument if needed.

Tests have also been added for the quoting.

Improves look and feel of changes in #1073
2025-02-19 21:00:46 -05:00
Jonah Graham
f5c54bd940
Fix mismatched id/name for CBuildConfigProvider (#1081)
This seems to only cause issues when using the plugin.xml GUI editor
because it cannot find the exsd file due to the incorrect id.
2025-02-19 21:00:23 -05:00
betamax
cf359d59ad
Stops CMake build output folders being named "default" (#1084)
The default IBuildConfiguration is no longer used by projects that use
ICBuildConfigurationProvider.

For CMake, Makefile and other Core Build projects the build output
folder is sometimes named "default" rather than the pattern
toolName.launchMode.toolchain OS.toolchain Arch.launchTarget Id (eg:
cmake.debug.win32.x86_64.Local). PR #1076 exposes new API
(ICBuildConfigurationProvider.getCBuildConfigName) to encourage this
naming pattern.

The "sometimes" is variable and often happens when a project is first
created when the active launch target is Local and the launch mode is
"run", but not always. This gives a random, inconsistent impression to
CDT.

The Platform project always contains a IBuildConfiguration with the name
IBuildConfiguration.DEFAULT_CONFIG_NAME. It seems the original Core
Build system design went to some length to fit in with this and always
make use of this IBuildConfiguration when pairing it with a new
ICBuildConfiguration.

With this PR, this no longer happens, allowing CDT code to be simplified
and the build folder naming made consistent, always adhering to
ICBuildConfigurationProvider.getCBuildConfigName.

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-024 Default
CMake build folder
2025-02-19 20:55:50 -05:00
Jonah Graham
47b1978568
Add internal API to CEditor to allow CDT-LSP to contribute a "try it" banner (#1088)
Part of https://github.com/eclipse-cdt/cdt/issues/968
2025-02-17 17:34:44 -05:00
Jonah Graham
ca5dabc3a3
Remove unneeded local variables and instanceof checks (#1087)
new AdaptedSourceViewer was unnecessarily upcast to ISourceViewer
leaving a bunch of null checks and instanceof checks in the rest
of the method. This commit removes the unneeded code.

This extra complication was a result of CDT following JDT, but the JDT
case has much more configurability which meant the extra instanceof
and null checks are needed for JDT case.
2025-02-16 11:57:32 -05:00
betamax
fc083dad86
The active Launch Target is now saved in the ICBuildConfiguration (#1076)
In addition to the active launch mode and toolchain, the active Launch
Target is now used to determine the Core Build Configuration
(ICBuildConfiguration).

The build output folder name now ends with the name of the Launch Target
(eg: cmake.debug.win32.x86_64.Local)

Additionally, API added to allow the ISV to configure the build output
folder name.

The ICBuildConfigurationProvider implementations, shown below, have been
tidied up to use common code.

  CMakeBuildConfigurationProvider
  AutotoolsBuildConfigurationProvider
  MakefileBuildConfigurationProvider
  MesonBuildConfigurationProvider

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-016 Launch
Targets used in ICBuildConfiguration
Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-018 Build
output folder name
2025-02-12 12:30:48 -05:00
Jonah Graham
0fcf41aacf
Bump org.eclipse.cdt.core/ui bundle version to 9.0.0 (#1063)
Some of the changes that are about to arrive have specific impacts
of API of core build. Because CBS is largely in org.eclipse.cdt.core/ui
any breaking changes to the CBS API necessitate bumping the entire
bundle to a new version.

One of the most noticeable changes is expected to be that
org.eclipse.cdt.core.build.ICBuildConfigurationProvider.createBuildConfiguration(IProject, IToolChain, String, IProgressMonitor)
needs a new parameter to properly connect the target. The upcoming
PR that makes the API change will document that change in the
CHANGELOG-API.md and N&N documentation.

Part of #1000
2025-01-29 14:21:09 -05:00
Jonah Graham
84d99f277a
Add some documentation and consistency to use of info vs output stream (#1060)
With some better Javadocs the cross referencing between IConsole
and the UI aspects of the console is a little easier to follow.

This resolves #1059 in two parts:

1. For Core Build System this update consistently uses info stream to
show information messages and output stream to be stdout of launched
build tool. This resolves the "Build Complete" appearing as the output
color when doing clean (See screenshots in #1059)

2. CBuildConfiguration.watchProcess(IConsole, IProgressMonitor) incorrectly
passed the info stream as the output stream. Mostly this was used for
the clean stage of builds. This resolves the CMake output like ("Cleaning
all built files...") appearing as the info color when doing clean (See
screenshots in #1059)

Fixes #1059
2025-01-28 18:54:38 -05:00
Jonah Graham
64ad743617 Update maven dependencies to latest versions, especially Hamcrest
Fixes #1037
2025-01-16 14:57:42 -05:00
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