Skip to content

[Based on #106] debug: validate embedded GDB Remote artifacts - #126

Open
cpunion wants to merge 1 commit into
codex/lldb-goroutine-stacks-20260801from
codex/embedded-debug-remote-2164-20260802
Open

[Based on #106] debug: validate embedded GDB Remote artifacts#126
cpunion wants to merge 1 commit into
codex/lldb-goroutine-stacks-20260801from
codex/embedded-debug-remote-2164-20260802

Conversation

@cpunion

@cpunion cpunion commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Part of xgo-dev#2164 Task 4.

Embedded target configuration already records preferred GDB commands, but that information was not exposed to debugger launchers, and the final Cortex-M artifact had no end-to-end source-debugging acceptance test.

This PR:

  • propagates target GDB candidates through crosscompile.Export;
  • builds a real Cortex-M host ELF with DWARF and proves that stripping its debug sections leaves identical target-loadable bytes;
  • validates the final artifact with both GDB Remote and LLDB gdb-remote against QEMU, including source breakpoints, locals, composite values, globals, and backtraces;
  • documents the equivalent OpenOCD transport contract and runs the check in Targets CI.

LLVM 19 LLD can leave tombstone DIEs after section GC, so verification uses a temporary garbage-collected copy while both debuggers consume the original ELF. This avoids changing the artifact or dropping live global-variable DIEs.

Local verification:

  • macOS: go test -timeout 20m ./internal/build -count=1
  • macOS: go test -coverprofile=... ./internal/crosscompile — 78.6%
  • Linux/ARM64: embedded QEMU + GDB Remote + LLDB remote integration
  • Linux/ARM64: go test -coverprofile=... ./internal/crosscompile — 77.3%
  • shellcheck and git diff --check

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

a5d810975080 | workflow run | long-term charts

Program measurements

Platform Workload File size vs main Build vs main Run vs main
Linux cprintf 19344 B +4.3% (worse) 310.521 ms -24.7% (better) 1.069 ms -31.1% (better)
Linux fmtprintf 2218824 B +0.2% (worse) 2.694 s -30.1% (better) 2.145 ms -34.7% (better)
Linux println 73832 B +1.6% (worse) 306.710 ms -23.3% (better) 1.362 ms -18.6% (better)
macOS cprintf 84672 B +0.0% 333.024 ms -19.6% (better) 2.354 ms -34.4% (better)
macOS fmtprintf 2361696 B +0.7% (worse) 4.499 s +14.2% (worse) 26.606 ms +13.8% (worse)
macOS println 125888 B -0.9% (better) 420.962 ms +1.5% (worse) 4.670 ms -35.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 9.662 ns/op -28.3% (better)
Linux BenchmarkMergeCompilerFlags 112.100 ns/op -27.4% (better)
Linux BenchmarkMergeLinkerFlags 72.430 ns/op -28.5% (better)
Linux BenchmarkChannelBuffered 29.730 ns/op -14.5% (better)
Linux BenchmarkChannelHandoff 19485 ns/op -39.2% (better)
Linux BenchmarkDefer 35.190 ns/op -37.5% (better)
Linux BenchmarkDirectCall 1.364 ns/op -12.7% (better)
Linux BenchmarkGlobalRead 1.384 ns/op -11.3% (better)
Linux BenchmarkGlobalWrite 2.179 ns/op -12.6% (better)
Linux BenchmarkGoroutine 24224 ns/op -68.0% (better)
Linux BenchmarkInterfaceCall 6.818 ns/op -12.5% (better)
Linux BenchmarkRuntimeGetG 1.641 ns/op -69.1% (better)
macOS BenchmarkLookupPCRandom 11.540 ns/op -7.2% (better)
macOS BenchmarkMergeCompilerFlags 117 ns/op -6.0% (better)
macOS BenchmarkMergeLinkerFlags 62.200 ns/op -10.3% (better)
macOS BenchmarkChannelBuffered 20.500 ns/op -26.1% (better)
macOS BenchmarkChannelHandoff 6543 ns/op -6.6% (better)
macOS BenchmarkDefer 24.960 ns/op -33.3% (better)
macOS BenchmarkDirectCall 0.941 ns/op -35.2% (better)
macOS BenchmarkGlobalRead 0.942 ns/op -22.2% (better)
macOS BenchmarkGlobalWrite 0.946 ns/op -36.4% (better)
macOS BenchmarkGoroutine 56197 ns/op +77.5% (worse)
macOS BenchmarkInterfaceCall 4.100 ns/op -24.0% (better)
macOS BenchmarkRuntimeGetG 2.045 ns/op -20.6% (better)

Compared only with the latest matching platform in the main series.

Warning

  • Persistent publishing is unavailable because no data token is configured.

@cpunion
cpunion force-pushed the codex/lldb-goroutine-stacks-20260801 branch from df1a018 to a9092db Compare August 2, 2026 07:05
@cpunion
cpunion force-pushed the codex/embedded-debug-remote-2164-20260802 branch from a5d8109 to 39dffea Compare August 2, 2026 07:05
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.

1 participant