debugger: lldb formatters for a native build (step 3 of #42) #600

Closed
opened 2026-10-29 14:33:34 +00:00 by orion · 8 comments
Collaborator

Context

Step 3 of #42 (epic: debug native programs, DEBUGGER.md section 4). Step 2 (#469, PR #471, merged 2026-10-24) writes the layout table next to a torb build --debug binary and ships the gdb pretty printers (tools/gdb/torb_printers.py, gate tools/debug-values.sh). lldb still shows the raw C structs.

Source

DEBUGGER.md sections 4, 11 and 18

Goal

A torb build --debug binary in an lldb session shows a String, List, Map, Set and the program's own records and cases the same way the gdb printers do, read from the same layout table.

Acceptance criteria

  • tools/lldb/torb_formatters.py (lldb Python, loaded by command script import; no auto-load into the binary) registers summary and synthetic-children providers for torb_text, torb_list, torb_map, torb_set and the table's records and cases, with the same output text, the same cut-offs (1000 characters, ten items, List(n) beyond) and the same <none> for a null storage pointer as the gdb printers
  • The formatters read the layout table from step 2 unchanged; the table format and the emitter are not touched
  • The tier B gate (tools/debug-values.sh) runs the same tests/debug-values/ fixture under lldb --batch and compares the locals with the same expected text as gdb; where lldb (with Python) is not installed it skips with a message, as for gdb. The measured result (is lldb on the CI runner image) goes into the PR body
  • DEBUGGER.md sections 4, 11 (native column) and 18 get a slice row for this step, marked Done; docs/tooling/ mentions the script

Seed

Adds a script and gate lines; no syntax, native, driver flag or looked-up std name changes. No seed refresh needed. A refresh would stay Torben's.

Size

One PR, two Conventional Commits: feat(debugger): lldb formatters for the layout table, test(debugger): run the value gate under lldb and document it.

Dependencies

After #469 (landed). Part of #42. Remaining after this step: torb debug for a native program, then docs and editor launch.

## Context Step 3 of #42 (epic: debug native programs, DEBUGGER.md section 4). Step 2 (#469, PR #471, merged 2026-10-24) writes the layout table next to a `torb build --debug` binary and ships the gdb pretty printers (`tools/gdb/torb_printers.py`, gate `tools/debug-values.sh`). lldb still shows the raw C structs. ## Source [DEBUGGER.md sections 4, 11 and 18](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/DEBUGGER.md) ## Goal A `torb build --debug` binary in an lldb session shows a `String`, `List`, `Map`, `Set` and the program's own records and cases the same way the gdb printers do, read from the same layout table. ## Acceptance criteria - [ ] `tools/lldb/torb_formatters.py` (lldb Python, loaded by `command script import`; no auto-load into the binary) registers summary and synthetic-children providers for `torb_text`, `torb_list`, `torb_map`, `torb_set` and the table's records and cases, with the same output text, the same cut-offs (1000 characters, ten items, `List(n)` beyond) and the same `<none>` for a null storage pointer as the gdb printers - [ ] The formatters read the layout table from step 2 unchanged; the table format and the emitter are not touched - [ ] The tier B gate (`tools/debug-values.sh`) runs the same `tests/debug-values/` fixture under `lldb --batch` and compares the locals with the same expected text as gdb; where `lldb` (with Python) is not installed it skips with a message, as for gdb. The measured result (is `lldb` on the CI runner image) goes into the PR body - [ ] DEBUGGER.md sections 4, 11 (native column) and 18 get a slice row for this step, marked Done; `docs/tooling/` mentions the script ## Seed Adds a script and gate lines; no syntax, native, driver flag or looked-up std name changes. No seed refresh needed. A refresh would stay Torben's. ## Size One PR, two Conventional Commits: `feat(debugger): lldb formatters for the layout table`, `test(debugger): run the value gate under lldb and document it`. ## Dependencies After #469 (landed). Part of #42. Remaining after this step: `torb debug` for a native program, then docs and editor launch.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-29T23:10:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261029-0858 until 2026-10-29T23:10:00Z
Author
Collaborator

[loop:torbscript] release implement: the worker was interrupted by a gateway restart after pushing de1874e9 to PR #601 (no release comment of its own). CI on de1874e9 decides: green goes to the merge gate, red gets a fix worker. next: waiting (CI on PR #601)

[loop:torbscript] release implement: the worker was interrupted by a gateway restart after pushing de1874e9 to PR #601 (no release comment of its own). CI on de1874e9 decides: green goes to the merge gate, red gets a fix worker. next: waiting (CI on PR #601)
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261030 until 2026-10-30T05:50:00Z (fix worker on PR #601: tier B red on 5ea3a2a0, review findings 555/566 and the PR body measurement)

[loop:torbscript] claim implement by session:loop-torbscript-20261030 until 2026-10-30T05:50:00Z (fix worker on PR #601: tier B red on 5ea3a2a0, review findings 555/566 and the PR body measurement)
Author
Collaborator

[loop:torbscript] release implement: fix worker pushed 43fbc42e to PR #601 (lldb formatter unwraps trait-typed boxed values; tier B on 5ea3a2a0 matched 6 of 8 bindings, List and Map showed the raw object). CI for 43fbc42e is queued. next: waiting (CI on PR #601); green: PR body gets the measured tier B line, then the merge gate; red: one more fix from the new diagnostics; still not run: downgrade DEBUGGER.md slice 9 to 'Built, not yet run in CI'.

[loop:torbscript] release implement: fix worker pushed 43fbc42e to PR #601 (lldb formatter unwraps trait-typed boxed values; tier B on 5ea3a2a0 matched 6 of 8 bindings, List and Map showed the raw object). CI for 43fbc42e is queued. next: waiting (CI on PR #601); green: PR body gets the measured tier B line, then the merge gate; red: one more fix from the new diagnostics; still not run: downgrade DEBUGGER.md slice 9 to 'Built, not yet run in CI'.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T06:00Z (third fix: tier B on 43fbc42e matched 6 of 8 bindings; List(Point) shows the ArrayList record and Map shows [:])

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T06:00Z (third fix: tier B on 43fbc42e matched 6 of 8 bindings; List(Point) shows the ArrayList record and Map shows [:])
Author
Collaborator

[loop:torbscript] release: fix pushed to PR #601 as 1daffa9a (formatters read C members through the non-synthetic value; ArrayList records shown as their window; debug-values.sh prints torb-diagnose for differing bindings). Untested locally (no lldb here). Next: tier B on 1daffa9a; green goes to Argus with the measured line.

[loop:torbscript] release: fix pushed to PR #601 as 1daffa9a (formatters read C members through the non-synthetic value; ArrayList records shown as their window; debug-values.sh prints torb-diagnose for differing bindings). Untested locally (no lldb here). Next: tier B on 1daffa9a; green goes to Argus with the measured line.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T09:30:00Z (fourth fix: tier B on 1daffa9a fails with UnboundLocalError 'raw' in text_of, torb_formatters.py line 388; the other bindings print correctly)

[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T09:30:00Z (fourth fix: tier B on 1daffa9a fails with UnboundLocalError 'raw' in text_of, torb_formatters.py line 388; the other bindings print correctly)
Author
Collaborator

[loop:torbscript] release fix: PR #601 is green at head ab5838bd (CI run 2452, tier B with DEBUG_VALUES_REQUIRE=lldb passed, so all 8 bindings match expected.txt). The fix renamed the local raw that shadowed raw() in text_of, plus a second shadow in type_of, and added tools/lldb/check_shadowing.py. Argus is requested as reviewer.
next: waiting (review of PR #601)

[loop:torbscript] release fix: PR #601 is green at head ab5838bd (CI run 2452, tier B with DEBUG_VALUES_REQUIRE=lldb passed, so all 8 bindings match expected.txt). The fix renamed the local raw that shadowed raw() in text_of, plus a second shadow in type_of, and added tools/lldb/check_shadowing.py. Argus is requested as reviewer. next: waiting (review of PR #601)
argus closed this issue 2026-10-30 07:01:23 +00:00
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
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#600
No description provided.