Skip to content

chore: add tests for debugging - #1510

Open
Ron (rjaegers) wants to merge 19 commits into
docs/improve-per-flavor-traceabilityfrom
docs/increase-traceability
Open

Ron (rjaegers) wants to merge 19 commits into
docs/improve-per-flavor-traceabilityfrom
docs/increase-traceability

Conversation

@rjaegers

Copy link
Copy Markdown
Member

🚀 Hey, I have created a Pull Request

Description of changes

This pull request adds and verifies support for the gdb-multiarch debugger in both C++ and Rust development environments, enabling automated debugging tests for both languages. It updates the devcontainer setup to include gdb-multiarch, configures the environment for its use, and adds integration tests to ensure debugging functionality works as expected.

Devcontainer and environment updates:

  • Added gdb-multiarch to the devcontainer tool inventory and apt requirements for both embedded and Rust environments, ensuring the debugger is available for C++ and Rust projects. [1] [2] [3]
  • Set the RUST_GDB environment variable to use gdb-multiarch by default in the Rust devcontainer, aligning Rust debugging with the new tool.

Debugging test coverage:

  • Added integration tests for C++ and Rust that compile debug-enabled binaries, set a breakpoint in main, inspect a variable, and verify the output using gdb-multiarch. [1] [2] [3] [4] [5]
  • Added a Rust-specific test to verify that rust-gdb can pretty-print Rust collection types, ensuring a better debugging experience for Rust developers. [1] [2]

Documentation and requirements:

  • Updated debugging feature documentation to clarify verification methods, specifying that integration suites use debuggers to set breakpoints and inspect variables, with embedded flavors verified without hardware.

✔️ Checklist

  • I have followed the contribution guidelines for this repository
  • I have added tests for new behavior, and have not broken any existing tests
  • I have added or updated relevant documentation
  • I have verified that all added components are accounted for in the SBOM
  • I understand the image size delta and agree the functionality justifies it

Ron (rjaegers) and others added 15 commits October 27, 2026 11:34
Show full source references in the SVP and RTM and distinguish declared traceability from execution evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep full procedure descriptions in the SVP and link to unique requirement/procedure anchors from the RTM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use stable test IDs and a textual SVP reference instead of Markdown cross-document links and HTML anchors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep full requirement descriptions in the SRS and preserve capability headings for context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Compile the SBDL model from product feature/test sources and the two annotated workflows instead of recursively ingesting the repository, keeping the documentation fixture out of the supplier model.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enumerate all test and workflow source files while excluding only the standalone sample SBDL fixture. Preserve the test model instead of narrowing directory roots.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove only the documentation fixture from the ephemeral checkout before invoking the SBDL compiler recursively. Keep compiler output outside the scanned tree until compilation succeeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Relocate requirement-only compatibility, maintainability, security, and debugging feature sources into docs/requirements while leaving executable scenarios under test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep flavor-specific BDD scenarios and their tags under test while moving compilation and analysis declarations to docs/requirements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep flavor-tagged Gherkin scenarios alongside their requirement declarations and filter acceptance test generation using the target flavor tag.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the BDD watcher to monitor docs/requirements and the actual Playwright harness paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-base:edge ➔ ghcr.io/philips-software/amp-devcontainer-base:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 95.71 MB 95.72 MB +6.85 kB (+0.01%) 🔼
linux/arm64 92.43 MB 92.43 MB 19 B (0%) 🔽

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 23 0 0 0.18s
✅ DOCKERFILE hadolint 4 0 0 0.22s
✅ JSON npm-package-json-lint yes no no 0.34s
✅ JSON prettier 53 15 0 0 1.71s
✅ JSON v8r 53 0 0 9.85s
✅ MARKDOWN markdownlint 13 0 0 0 0.61s
✅ MARKDOWN markdown-table-formatter 13 0 0 0 0.19s
✅ REPOSITORY betterleaks yes no no 1.34s
✅ REPOSITORY checkov yes no no 13.96s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY grype yes no no 66.64s
⚠️ REPOSITORY osv-scanner yes 1 4 1.4s
✅ REPOSITORY secretlint yes no no 0.81s
✅ REPOSITORY syft yes no no 2.49s
✅ REPOSITORY trivy yes no no 12.17s
✅ REPOSITORY trivy-sbom yes no no 0.26s
✅ REPOSITORY trufflehog yes no no 2.71s
✅ SPELL lychee 125 0 0 9.25s
✅ YAML prettier 36 1 0 0 0.74s
✅ YAML v8r 36 0 0 7.73s
✅ YAML yamllint 36 0 0 0.69s

Detailed Issues

⚠️ REPOSITORY / osv-scanner - 1 error
warning: Package 'minimatch@10.2.6' is vulnerable to 'CVE-2026-118764' (also known as 'GHSA-g3hv-75wg-m249').
 = CVE-2026-118764: minimatch has potential denial of service via globparts amplification
 = minimatch 10.2.6 contains an attacker-controlled pattern amplification in firstPhasePreProcess() when optimizationLevel >= 2.
   
   researcher: Reid Downing (b1nv0id)
   files: 
   
   - src/index.ts: 690-770
   - src/index.ts: 780-796
   
   issue:
   input-controlled growth of globParts during first-phase preprocessing, followed by quadratic second-phase processing.
   
   the **/../ transformation clones a globparts entry and appends the clone to the same globparts array:

parts.splice(gs, 1)
const other = parts.slice(0)
other[gs] = '**'
globParts.push(other)

this occurs inside a do...while (didSomething) fixpoint loop, allowing generated entries to be processed again.

the expanded globparts array is subsequently processed by secondPhasePreProcess(), which performs pairwise comparisons:

for (let i = 0; i < globParts.length - 1; i++) {
for (let j = i + 1; j < globParts.length; j++) {
this.partsMatch(...)
}
}

an attacker who can supply a glob pattern can therefore cause additional pattern entries to be generated during preprocessing, followed by quadratic pairwise processing, resulting in excessive cpu and memory consumption.

warning: Package 'minimatch@10.2.4' is vulnerable to 'CVE-2026-118764' (also known as 'GHSA-g3hv-75wg-m249').
= CVE-2026-118764: minimatch has potential denial of service via globparts amplification
= minimatch 10.2.6 contains an attacker-controlled pattern amplification in firstPhasePreProcess() when optimizationLevel >= 2.

researcher: Reid Downing (b1nv0id)
files: 

- src/index.ts: 690-770
- src/index.ts: 780-796

issue:
input-controlled growth of globParts during first-phase preprocessing, followed by quadratic second-phase processing.

the **/../ transformation clones a globparts entry and appends the clone to the same globparts array:

parts.splice(gs, 1)
const other = parts.slice(0)
other[gs] = '**'
globParts.push(other)

this occurs inside a do...while (didSomething) fixpoint loop, allowing generated entries to be processed again.

the expanded globparts array is subsequently processed by secondPhasePreProcess(), which performs pairwise comparisons:

for (let i = 0; i < globParts.length - 1; i++) {
for (let j = i + 1; j < globParts.length; j++) {
this.partsMatch(...)
}
}

an attacker who can supply a glob pattern can therefore cause additional pattern entries to be generated during preprocessing, followed by quadratic pairwise processing, resulting in excessive cpu and memory consumption.

warning: Package 'bare-metal@0.2.5' is vulnerable to 'RUSTSEC-2026-0110'.
= RUSTSEC-2026-0110: bare-metal is deprecated
= The `bare-metal` crate has been deprecated and archived.

For `Mutex` and `CriticalSection`, see the [`critical-section`](https://crates.io/crates/critical-section) crate instead.

warning: Package 'bare-metal@0.2.5' is vulnerable to 'RUSTSEC-2026-0110'.
= RUSTSEC-2026-0110: bare-metal is deprecated
= The `bare-metal` crate has been deprecated and archived.

For `Mutex` and `CriticalSection`, see the [`critical-section`](https://crates.io/crates/critical-section) crate instead.

warning: 4 warnings emitted

See detailed reports in MegaLinter artifacts

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,DOCKERFILE_HADOLINT,JSON_V8R,JSON_PRETTIER,JSON_NPM_PACKAGE_JSON_LINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-docs:edge ➔ ghcr.io/philips-software/amp-devcontainer-docs:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 227.22 MB 227.23 MB +6.84 kB (+0%) 🔼
linux/arm64 222.18 MB 222.18 MB +8 B (+0%) 🔼

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-embedded-rust:edge ➔ ghcr.io/philips-software/amp-devcontainer-embedded-rust:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 518.67 MB 543.29 MB +24.62 MB (+4.75%) 🔼
linux/arm64 458.57 MB 483.52 MB +24.95 MB (+5.44%) 🔼

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-rust:edge ➔ ghcr.io/philips-software/amp-devcontainer-rust:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 451.93 MB 476.59 MB +24.65 MB (+5.46%) 🔼
linux/arm64 391.73 MB 416.75 MB +25.02 MB (+6.39%) 🔼

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-embedded-cpp:edge ➔ ghcr.io/philips-software/amp-devcontainer-embedded-cpp:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 625.86 MB 625.86 MB +5.11 kB (+0%) 🔼
linux/arm64 603.22 MB 603.22 MB +1.13 kB (+0%) 🔼

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 Container Size Analysis

Note

Comparing ghcr.io/philips-software/amp-devcontainer-cpp:edge ➔ ghcr.io/philips-software/amp-devcontainer-cpp:pr-1510

📈 Size Comparison Table

OS/Platform Previous Current Change Trend
linux/amd64 423.7 MB 423.71 MB +7.79 kB (+0%) 🔼
linux/arm64 401.83 MB 401.83 MB +1.37 kB (+0%) 🔼

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 25 files  ± 0   25 suites  ±0   9m 24s ⏱️ - 3m 1s
 60 tests + 3   60 ✅ + 3  0 💤 ±0  0 ❌ ±0 
309 runs  +12  309 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit d0120cc. ± Comparison against base commit 4b723d8.

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new GDB integration test fails because the gcc preset builds only test-gcc, leaving the required test-debug executable missing; the test must explicitly build that target.

1 open issue
What changed in this PR

This PR adds automated debugger verification for the C++ and Rust devcontainers and configures Rust environments to use gdb-multiarch.

Changes:

  • Adds gdb-multiarch to Rust package requirements and tool inventories, and sets RUST_GDB.
  • Adds C++ and Rust breakpoint and variable-inspection tests, plus Rust collection pretty-printing coverage.
  • Documents debugger verification scope, including hardware-independent checks for embedded flavors.
File Description
test/​rust/​workspace/​rust/​pretty-print.rs Adds a vector fixture for pretty-printing checks.
test/​rust/​workspace/​rust/​debug.rs Adds a variable-inspection fixture.
test/​rust/​integration-tests.bats Adds Rust debugger and pretty-printing tests.
test/​cpp/​workspace/​gcc/​debug.cpp Adds a C++ debugging fixture.
test/​cpp/​workspace/​gcc/​CMakeLists.txt Defines a debug-enabled test executable.
test/​cpp/​integration-tests.bats Adds a C++ debugger integration test.
docs/​requirements/​debugging.feature Documents debugger verification methods and scope.
.devcontainer/​rust/​tool-inventory.json Records gdb-multiarch in the Rust inventory.
.devcontainer/​rust/​Dockerfile Sets RUST_GDB to gdb-multiarch.
.devcontainer/​rust/​apt-requirements.json Adds the pinned debugger package.
.devcontainer/​embedded-rust/​tool-inventory.json Records the debugger in the embedded Rust inventory.

Review effort: Balanced

Comment thread test/cpp/integration-tests.bats Outdated
@test "gdb-multiarch should set a breakpoint and inspect a C++ variable" {
# @sbdl test-debug-0001 is test { custom:title is [[[[@-LINE]]]]; requirement is req-debug-0001 }
cmake --preset gcc
cmake --build --preset gcc
Comment on lines +72 to +74
"targets": [
"test-clang-cl"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-clang-cl"
]
"targets": ["test-clang-cl"]

Comment on lines +79 to +81
"targets": [
"test-fuzzing"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-fuzzing"
]
"targets": ["test-fuzzing"]

Comment on lines +86 to +89
"targets": [
"test-asan",
"test-ubsan"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-asan",
"test-ubsan"
]
"targets": ["test-asan", "test-ubsan"]

Comment on lines +94 to +96
"targets": [
"test-fuzzing"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-fuzzing"
]
"targets": ["test-fuzzing"]

Comment on lines +101 to +103
"targets": [
"test-clang-iwyu"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-clang-iwyu"
]
"targets": ["test-clang-iwyu"]

Comment on lines +168 to +170
"targets": [
"test-gcc-debug"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-gcc-debug"
]
"targets": ["test-gcc-debug"]

Comment on lines +175 to +177
"targets": [
"test-gcc-fail"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-gcc-fail"
]
"targets": ["test-gcc-fail"]

Comment on lines +182 to +184
"targets": [
"test-gcc-lld"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-gcc-lld"
]
"targets": ["test-gcc-lld"]

Comment on lines +189 to +193
"targets": [
"test-asan",
"test-threadsan",
"test-ubsan"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-asan",
"test-threadsan",
"test-ubsan"
]
"targets": ["test-asan", "test-threadsan", "test-ubsan"]

Comment on lines +198 to +200
"targets": [
"test-mutation"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-mutation"
]
"targets": ["test-mutation"]

@rjaegers

Copy link
Copy Markdown
Member Author

Copilot resolve the merge conflicts

…lity' into docs/increase-traceability

# Conflicts:
#	.devcontainer/embedded-rust/tool-inventory.json
#	.devcontainer/rust/tool-inventory.json
#	.github/workflows/build-push-test.yml

Co-authored-by: rjaegers <45816308+rjaegers@users.noreply.github.com>

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts

Merged docs/improve-per-flavor-traceability and resolved the conflicts in commit d0120cc.

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

with:
acceptance-test-path: ${{ (github.actor != 'dependabot[bot]' && matrix.flavor == 'cpp') && 'test/cpp/features' || '' }}
acceptance-test-tag: "@flavor:${{ matrix.flavor }}"
acceptance-test-tag: '@flavor:${{ matrix.flavor }}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MegaLinter] reported by reviewdog 🐶

Suggested change
acceptance-test-tag: '@flavor:${{ matrix.flavor }}'
acceptance-test-tag: "@flavor:${{ matrix.flavor }}"

Copilot AI deployed to acceptance-testing November 6, 2026 11:23 Active

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants