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

36427 commits

Author SHA1 Message Date
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
John Dallaway
6fd372066e
Update "Before you begin" help to reference MSYS2 packages
Co-authored-by: Jonah Graham <jonah@kichwacoders.com>
2025-02-15 14:20:10 +00:00
Jonah Graham
f43b833f01
Make sure that if any of the piped commands fail, the cleanliness fails (#1083) 2025-02-12 15:46:03 -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
John Dallaway
f0c74ed38d Update SimRel version for CDT 12.0 2025-02-08 17:12:40 +00:00
John Dallaway
12e4b8e74c Add bugs fixed in 12.0.0 milestone builds to N&N 2025-02-08 13:38:51 +00:00
alicetrifu
b6d64ed76d
Issue #1058: Moved generation of the compile_commands.json (#1075)
Moved compile_commands.json file to performPrebuildGeneration, so the
file to be generated only when Makefiles generation is set to be on.
2025-02-03 10:36:17 -05:00
ewaterlander
c8e47b321d
Getting Started documentation update. (#1056)
* Put Core Build and Managed Build items in separate topics.
* Added two images to Creating a CMake project.
* Added new pages about creating a CBS Makefile project, using
  existing code, launch bar, building, running, and debbuggin
  a project.
* Renamed "Creating a simple application" to "Creating a Managed Build
  System Makefile project" and replaced two images.
* Removed "Creating a Makefile project", because it was duplicate
  information.

Fixes #992
2025-01-30 09:03:07 -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
889a5f1db5
Add CDT-LSP to API Baseline (#1066)
See https://github.com/eclipse-cdt/cdt-lsp/pull/406#issuecomment-2622119241
2025-01-29 12:43:15 -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
0564831d1e
Fix copy and paste error in CMake manual test instructions (#1062)
Both 5 and 6 were titled the same, but 6 sub steps are correctly
for the clean target

Fixup for #1046
2025-01-28 14:18:34 -05:00
Raghunandana
62faf42bfc
Restrict Pin View and Open View to active CPP debug context. (#1049)
That is if any CPP application is under debug. Because Pin View is never
enabled other than CPP application debug session.

This also includes Action to Command migration.

Fixes https://github.com/eclipse-cdt/cdt/issues/1048
2025-01-27 12:31:51 -05:00
betamax
fe74d8dfee
Improve CMake build option handling and API (#1046)
Summary:

- Add some new API to make it easier for ISVs to provide defaults.
- Fully connect UI elements to CMake build process
- Add some missing UI elements (such as customizing generator)
- CMake generator default within CDT changed to Ninja

Details:

Add API to set CMake generator default (eg Ninja) ISV can set
their desired CMake generator by overriding
`CMakeBuildConfiguration.getDefaultProperties`. ISVs can also further
fine tune the build process by overriding
`CMakeBuildConfiguration.getDefaultProperties`

Remove API `IOsOverrides` and related code. `IOsOverrides` was a partial
implementation to achieve builds in Docker containers, however the
work was not complete and it the extra code was complicating some
basic use cases of setting defaults

Add support for all generators to CMake build settings UI page by
using a Combo instead of radio buttons. The non-deprecated generators
that are built-in to CDT populate the Combo, but additional generators
can be manually entered in the Combo.

Rename clean command to clean target to better reflect its use as
the argument passed to cmake's --target command line.

Add all target for the argument passed to cmake's --target
command line when doing a normal build.

Clarify usage of UI overrides and change the UI to be "use defaults"
(i.e. invert the checkbox). This is a **breaking** change as it means
user projects that were using UI overrides will revert to using defaults.
This is done on purpose as so many little things have changed in CMake
settings, that reverting to defaults on upgrade seems like a logical
decision. In addition *use defaults* matches the other GUIs in Eclipse,
for example the MBS build command settings.

Populate all defaults in getDefaultProperties() so that all CMake build
settings are displayed as used (greyed out) and can be used as a starting
point when editing settings.

Simplify some of the code in CMakeBuildTab.

Fix parsing of extra args so that quoted strings work.

Refactored manual tests document and brought it up to date.

Correct command line option for CMake's --warn-unused-vars

Correct command line option for CMake's --warn-uninitialized

Overall this is an API breaking change and the CHANGELOG-API.md has been
updated with all the API changes in and around ICMakeProperties,
including fixing typos in WarnUninitialized methods.

Fixes #1055
Fixes #818
Part of #1000

Co-authored-by: Jonah Graham <jonah@kichwacoders.com>
2025-01-27 12:31:38 -05:00
Jonah Graham
11dfaa4c0b Try automatically re-running failed tests
This will try to rerun failed tests up to three times.
The side effect is that a very broken test run will take much
longer to complete, but it is hoped for those few
https://github.com/eclipse-cdt/cdt/labels/flakytests in the system
this will resolve the issue.

Note this is applied only to the GitHub actions run, not to Jenkins
run where we build releases from. Ideally we don't want to do that
there.

In a future commit we can consider removing flakyTest from -DexcludedGroups
too.

See [surefire docs](https://maven.apache.org/surefire/maven-surefire-plugin/examples/rerun-failing-tests.html)
for details.
2025-01-24 14:04:47 -05:00
Jonah Graham
e6cac160f4 Allow a little more time for tests to run
The DSF-GDB tests themselves can take an hour or so.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
d82e1ef833 Add some extra info when terminate fails in tests
On GitHub I see fails in resume[gdb] (org.eclipse.cdt.tests.dsf.gdb.tests.MIRunControlTest)

with this output:

```
Terminate failed
org.eclipse.debug.core.DebugException: Terminate failed
	at org.eclipse.debug.core.Launch.terminate(Launch.java:300)
	at org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.terminate(GdbLaunch.java:313)
	at org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase.doAfterTest(BaseTestCase.java:662)
	at org.eclipse.cdt.tests.dsf.gdb.tests.MIRunControlTest.doAfterTest(MIRunControlTest.java:133)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunAfters.invokeMethod(RunAfters.java:46)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Contains: Terminate failed
Contains: Terminate failed
790,475 "resume[gdb]" requesting gdb. Launched gdb 15.0.50.20240403.
```

which is insufficient to diagnose what is happening.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
833f9391b7 Explicitly start gdb with mi2
We should explicitly set the version of mi to use. Until recently
mi == mi2, but with the recent introduction of mi3 as the default
we need to be explicit.

The other place that specifies interpreter is explicit about version
and includes an important comment on the subject

1590791e76/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java (L189-L191)

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
3594dce68a Fix for GDB 13 "script" field in breakpoint
"script" field of a breakpoint used to be output as a tuple (<= GDB 12),
though it is a list. There are cases of flags that can be applied to
get old or new behaviour too.
This code handles both cases transparently.
See https://sourceware.org/bugzilla/show_bug.cgi?id=24285

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
259fb0f99d Run the loop fewer times
This test sometimes hangs when run a lot. As best as I can tell this
is a Ubuntu problem, rather than a gdb problem as it only fails on
Ubuntu 24.04, but I am not sure. I cannot reproduce the problem
when using the UI.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
a3fe42d7af Update tests for GDB >= 12 for change in formatted values
From GDB news:

print
  Printing of floating-point values with base-modifying formats like
  /x has been changed to display the underlying bytes of the value in
  the desired base.  This was GDB's documented behavior, but was never
  implemented correctly.

This commit updates the tests to accomodate GDB's change.

Fixes #210
2025-01-24 14:04:47 -05:00
Jonah Graham
0d60cb3fdc Fix undefined behaviour in C code problem
Without the return, this code would core dump, depending
on compiler version. The compiler was generating a warning
too about the missing return.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
dc77c1f3bb Make first line of C method consistent
The tests were relying on specific number of executable lines
in a function. However on some gdb/gcc combinations stopping
at a function stops at the line with the `{` and some
on the first line witin that function. Much of the tests
here assumed that latter. By using line tags we don't need
to worry about exact number of executable lines between entry
and area of interest. And by placing first line of code on
the same line as the opening `{` of the function, we can
have consistent stop locations when stepping into a function.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
b1e0121177 Use most recent Ubuntu when running tests
The combination of gcc 9.4 and gdb 9.2 in Ubuntu 20.04 have a few
minor test issues that seem to be bugs in gdb that have been since
fixed.

Part of #816
2025-01-24 14:04:47 -05:00
Jonah Graham
5e62200e60
Provide an example of extending CMake project type in Core Build (#1052)
In issue #1000 a lot of the work is on exposing a better API to ISVs.
This new project serves these purposes:

- Ensure the exposed API works in practice
- Example for ISVs to use if they want to extend CMake
- Provide an in-tree example of the API in use, so future editors of
  CDT have better chance of understanding *why* items are done as
  they are.
2025-01-23 09:20:39 -05:00
Jonah Graham
978eea5d42
Allow the new API for CMakeBuildConfiguration to be extended (#1051)
PR #1010 added the ability to extend CMakeBuildConfiguration and
CMakeBuildConfigurationProvider by making the classes public
API, they used to be internal API.

This change makes it easier to reuse the code in the provider
and configuration by allowing extenders to provide their own
implementations of CMakeBuildConfiguration. This has been
achieved by adding createCMakeBuildConfiguration methods to
control which CMakeBuildConfiguration is constructed.

Follow up to #1010
2025-01-23 09:20:11 -05:00
Jonah Graham
9c4ace138c
Fix XML syntax error in freemarker manifest (#1054)
The extra " inside XML property was actually being processed properly
by freemarker (surprisingly!), but XML editors/viewers reported an
error.
2025-01-22 16:39:20 -05:00
Jonah Graham
c5cc700a2d
Check that all xml files in CDT are well formed (#1053) 2025-01-22 16:38:40 -05:00
ewaterlander
9e04dc537b
Fixed CBS Makefile template for profiling. (#1043)
Fixed BUILD_MODE="linuxtools". Changed to "profile".

Added -O0 to BUILD_MODE=debug.
2025-01-20 11:45:27 -05:00
Jonah Graham
1abb9900db
Restore the empty activity IDs (#1045)
In #974 I removed activities we were not using anymore, but it turns
out if LaunchUtils.enableActivity is called on a removed id, strange
things happen, such as other activities incorrectly being enabled.
This may be a bug in platform, or just undefined behavior. But because
extenders do have calls to LaunchUtils.enableActivity in their code,
leave the empty activity ids behind.

Fixes #1044
2025-01-17 12:09:21 -05:00
Jonah Graham
5667224c61
Run DSF-GDB tests when releng may have changed (#1042)
On a recent update to the target platform, the DSF-GDB tests
did not run because none of the changes matched the dsf
filter. Going forward, include running DSF tests when any
releng changes happen.

This replaces commit 8d0642568c. That commit ran the tests
all the time, which was too slow.

Part of #1037
2025-01-17 12:08:39 -05:00
astrograph
3439e0e7e0
use UTF-8 as default encoding in the Terminal (#1020)
the rest of Eclipse now uses UTF-8 as default encoding.

The tm.terminal code reverts to null when the encoding
begins with "Default" and this leads to UTF-8 being
selected from Charset.defaultEncoding instead of ISO-8859
when the displayed default value is selected.

Co-authored-by: Philipp SALZGEBER <philipp.salzgeber@bachmann.info>
2025-01-17 09:25:06 -05:00
Jonah Graham
8d0642568c Run DSF-GDB tests all the time
Part of #1037
2025-01-16 14:57:42 -05:00
Jonah Graham
45de3f3d77 Save all log files
When some types of failures happen, such as that in #1037, a log
file is created, so save all .log files as artifacts.

Part of #1037
2025-01-16 14:57:42 -05:00
Jonah Graham
64ad743617 Update maven dependencies to latest versions, especially Hamcrest
Fixes #1037
2025-01-16 14:57:42 -05:00
Jonah Graham
89b8685886 Reorder file in the order that the category editor saves it 2025-01-16 14:57:42 -05:00
Jonah Graham
957bb48267
Update to latest versions of build tools (#1036)
This is a follow-up to #986 where I missed this version update.
2025-01-16 18:56:24 +00:00
ewaterlander
c4f22cd1e7
Search debugger first in selected CBS toolchain. (#1033)
For Core Build System local debug target. If there is no absolute path
set in the Debugger tab of the launch configuration, try to find the
debugger first in the selected toolchain. If the debugger is not found
in the toolchain, let GdbLaunch search in PATH.
If an absolute path is set, GdbLaunch will use that.

Fixes #1008
2025-01-16 12:03:11 -05:00
Jonah Graham
2efeaae713
Shorten the name of the licensing check (#1032)
This helps it fit in the UI space GitHub gives it

Part of #1002
2025-01-16 11:08:47 -05:00
Jonah Graham
751b031f09
Revert "workaround test results appearing in incorrect spot" (#1031)
This reverts commit ae3aebcf7f.

Part of #1002
2025-01-15 21:47:14 -05:00
Jonah Graham
ae3aebcf7f workaround test results appearing in incorrect spot
Part of #1002
2025-01-15 17:33:40 -05:00
Jonah Graham
6a60995312
Update path to dash-licenses (#1023)
When Eclipse Dash got moved to its own org, the path the shared
workflow needed to be updated. This commit does that

Part of #1002
2025-01-15 16:16:56 -05:00
Jonah Graham
9ec6c531e5 Correct location of event.json for reporting results
Part of #1002
2025-01-15 16:10:59 -05:00
Jonah Graham
47ecc78979
Use event file to line up PR build and reporting (#1026)
Part of #1002
2025-01-15 15:35:33 -05:00
Jonah Graham
1b0fcf3e4b Revert "Experiment to include full debug info"
Part of #1002
2025-01-15 14:39:41 -05:00
Jonah Graham
069209d474 Experiment to include full debug info
Part of #1002
2025-01-15 14:23:28 -05:00
Jonah Graham
1c8edca92f Fix broken https link in setup
Fixes break introduced yesterday in 75ef178ffd
2025-01-15 11:40:22 -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
Fred G
e93588a8b9
Reduce disk usage (#1009)
This change should be applied to all branches and controllable forks.
2025-01-15 10:13:22 -05:00
Jonah Graham
4d2ed9dacf
Remove generation of adoc files in code cleanliness (#1005)
This was supposed to be a check to ensure adoc generation was
working, but it interferes with the overall check code cleanliness
as it leads to jgit dirty errors.

The generation of the docs is done as part of the build too, so
it is redundant to do them here.
2025-01-14 21:19:22 -05:00