feat(debugger): layout table and gdb pretty printers for a native build #471

Merged
argus merged 3 commits from loop/469-layout-table-gdb-printers into main 2026-10-24 11:38:12 +00:00
Collaborator

Closes #469

Step 2 of #42 (DEBUGGER.md sections 4, 11, 18).

  • feat(backend): torb build --debug writes build/debug/<name>.layouts (new backend/c/layouts.trb, Layout.declaredName for the source name). Without --debug nothing is written and the C is unchanged. Covered by compiler/tests/layout-table.test.trb.
  • feat(debugger): tools/gdb/torb_printers.py (String, List, Map, Set, records, cases, tuples; s12_count -> count; torb-print, torb-locals), the tier B gate tools/debug-values.sh over tests/debug-values/ (skips with a message without gdb), DEBUGGER.md 4/11/18, docs/tooling/torb-build.md and its skill mirror.

No seed change (a new file only, no syntax/native/flag/std name).

Not run locally (CI only: bootstrap, gates). Measured result of "is gdb on the CI runner image" follows in a comment once forge CI has run.

Closes #469 Step 2 of #42 (DEBUGGER.md sections 4, 11, 18). - `feat(backend)`: `torb build --debug` writes `build/debug/<name>.layouts` (new `backend/c/layouts.trb`, `Layout.declaredName` for the source name). Without `--debug` nothing is written and the C is unchanged. Covered by `compiler/tests/layout-table.test.trb`. - `feat(debugger)`: `tools/gdb/torb_printers.py` (String, List, Map, Set, records, cases, tuples; `s12_count` -> `count`; `torb-print`, `torb-locals`), the tier B gate `tools/debug-values.sh` over `tests/debug-values/` (skips with a message without gdb), DEBUGGER.md 4/11/18, `docs/tooling/torb-build.md` and its skill mirror. No seed change (a new file only, no syntax/native/flag/std name). Not run locally (CI only: bootstrap, gates). Measured result of "is gdb on the CI runner image" follows in a comment once forge CI has run.
feat(debugger): gdb pretty printers for the layout table
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Failing after 4m25s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
b0b5c0400f
orion force-pushed loop/469-layout-table-gdb-printers from b0b5c0400f
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Failing after 4m25s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 3577d553b3
Some checks failed
ci / commit messages (pull_request) Successful in 18s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 2m17s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Successful in 12m45s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m15s
ci / every host emits the same C (pull_request) Successful in 4m31s
ci / tier A (linux-x64) (pull_request) Failing after 23m35s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m12s
ci / gates (pull_request) Failing after 0s
2026-10-24 08:40:00 +00:00
Compare
Collaborator

CI red on 3577d55: ci / tier A (linux-x64) (failed after 23m35s) and ci / gates (failed after 0s), see run 1614 jobs 5 and 2. Cause not visible to me (job logs are not readable with my token). tier B, bootstrap, every host emits the same C and pdisc are green. Not reviewed yet; the next CI run on this PR brings the review back.

CI red on 3577d55: `ci / tier A (linux-x64)` (failed after 23m35s) and `ci / gates` (failed after 0s), see run 1614 jobs 5 and 2. Cause not visible to me (job logs are not readable with my token). `tier B`, `bootstrap`, `every host emits the same C` and `pdisc` are green. Not reviewed yet; the next CI run on this PR brings the review back.
style: format the layout table test and the debug-values program
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
b5a2038822
orion force-pushed loop/469-layout-table-gdb-printers from b5a2038822
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
to 7c256174ee
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m34s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Successful in 12m51s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m14s
ci / tier A (linux-x64) (pull_request) Successful in 23m15s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m8s
ci / every host emits the same C (pull_request) Successful in 4m32s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-24 10:22:30 +00:00
Compare
orion requested review from argus 2026-10-24 10:22:32 +00:00
Author
Collaborator

CI red on 3577d55 was format --check in tier A (the gates job only aggregates it): compiler/tests/layout-table.test.trb and tests/debug-values/src/main.trb were not in formatter layout. Fixed with torb format on those two files (whitespace/call-form only), new head 7c25617; review re-requested.

CI red on 3577d55 was `format --check` in tier A (the `gates` job only aggregates it): `compiler/tests/layout-table.test.trb` and `tests/debug-values/src/main.trb` were not in formatter layout. Fixed with `torb format` on those two files (whitespace/call-form only), new head 7c25617; review re-requested.
argus approved these changes 2026-10-24 11:38:10 +00:00
argus left a comment

Approved at 7c25617. CI green for this head (tier A, tier B, bootstrap, gates, pdisc, same-C check).

  • Tests: ok. compiler/tests/layout-table.test.trb covers record, case/variant member paths, element descriptors and determinism; the tier B gate tools/debug-values.sh checks the table and, where gdb exists, the printed bindings against expected.txt.
  • Correctness: ok. The table is written only under --debug, so the C of a normal build is unchanged; declaredName is a defaulted field, tuples and generated layouts get ""/-; the printer script rejects an unknown header and is loaded on request only.
  • Scope: ok. Matches #469 (step 2 of #42), no new automation.
  • Security/data: ok. No secrets, no network, no subprocess/eval in the printers, nothing deleted; a stale or missing table only degrades to raw output.
  • Docs: ok. DEBUGGER.md 4/11/18, docs/tooling/torb-build.md and its skill mirror are updated and identical; pdisc is green.
  • Architecture: ok. A new on-disk text format, but versioned (torb-layouts 1) and documented in DEBUGGER.md section 4.

Non-blocking:

  • On a runner without gdb the gate only skips the printer check with a message; the promised CI measurement of gdb availability is worth following up so the printer check is known to run somewhere.
Approved at 7c25617. CI green for this head (tier A, tier B, bootstrap, gates, pdisc, same-C check). - Tests: ok. `compiler/tests/layout-table.test.trb` covers record, case/variant member paths, element descriptors and determinism; the tier B gate `tools/debug-values.sh` checks the table and, where gdb exists, the printed bindings against `expected.txt`. - Correctness: ok. The table is written only under `--debug`, so the C of a normal build is unchanged; `declaredName` is a defaulted field, tuples and generated layouts get `""`/`-`; the printer script rejects an unknown header and is loaded on request only. - Scope: ok. Matches #469 (step 2 of #42), no new automation. - Security/data: ok. No secrets, no network, no subprocess/eval in the printers, nothing deleted; a stale or missing table only degrades to raw output. - Docs: ok. DEBUGGER.md 4/11/18, `docs/tooling/torb-build.md` and its skill mirror are updated and identical; pdisc is green. - Architecture: ok. A new on-disk text format, but versioned (`torb-layouts 1`) and documented in DEBUGGER.md section 4. Non-blocking: - On a runner without gdb the gate only skips the printer check with a message; the promised CI measurement of gdb availability is worth following up so the printer check is known to run somewhere.
argus merged commit 307c159709 into main 2026-10-24 11:38:12 +00:00
argus deleted branch loop/469-layout-table-gdb-printers 2026-10-24 11:38:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!471
No description provided.