debugger: debug native programs #42

Open
opened 2026-10-05 21:07:13 +00:00 by orion · 10 comments
Collaborator

Context

Section 4 describes debugging a native build.

Source

Acceptance criteria

  • A native program can be debugged as section 4 designs it

Dependencies

None known.

Moved from the planning lists of the docs; the design record stays the specification.

## Context Section 4 describes debugging a native build. ## Source - [DEBUGGER.md section 20](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/DEBUGGER.md#L416) ## Acceptance criteria - [ ] A native program can be debugged as section 4 designs it ## Dependencies None known. _Moved from the planning lists of the docs; the design record stays the specification._
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop). Implements DEBUGGER.md section 20 / section 4 (debugging a native build); the design record is the specification, no collision with CONCEPT "Open Questions". Touches the native back end and debugger; the acceptance criterion is a single line and will need testable slices, plus a platform question for CI, settled in refine. next: refine (queued)

[loop:torbscript] intake: in scope (author orion, label loop). Implements DEBUGGER.md section 20 / section 4 (debugging a native build); the design record is the specification, no collision with CONCEPT "Open Questions". Touches the native back end and debugger; the acceptance criterion is a single line and will need testable slices, plus a platform question for CI, settled in refine. next: refine (queued)
Author
Collaborator

[loop:torbscript] refine: still queued behind the intake order. next: waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z

[loop:torbscript] refine: still queued behind the intake order. next: waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T03:39:59Z

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T03:39:59Z
Author
Collaborator

[loop:torbscript] decided by the loop: #42 is an epic and gets no ready itself. Section 4 plus the C back end (a #line per block only, Statement ignored by backend/c/body.trb, torb build never lowers for debugging, -g only through the profile's debugInformation) make four steps; each is one PR, the next is filed only when the previous lands:

  • #405 native build: a #line per statement of a debugged lowering, torb build --debug (-O0 -g), DWARF line-table gate (ready)
  • layout table the emitter writes, and the gdb (Python) and lldb (formatter) pretty printers for torb_text, torb_list, torb_map and the program's layouts
  • torb debug launches lldb-dap or gdb --interpreter=dap for a native program, translates s12_count to count in variables; a session in tests/debug/
  • docs (torb-debug.md, editor guide) and the VS Code launch for a native program; DEBUGGER.md sections 4, 18, 20

Why these decisions: the design record fixes the options (section 4 chose gdb/lldb behind DAP, not a second adapter), so no owner question. Adapter choice for step 3: lldb-dap if found, else gdb --interpreter=dap (gdb 14+); the CI gate runs on linux-x64 only and is measured first (is a debugger installed on the runner image; if not, the image gains it in a PR of its own, no runner change). Platform scope: the debugger session test is linux-x64; macOS and Windows are checked by the line-table gate only. Ordering: independent of #403 (task threads) and #39 (evaluate); all three touch DEBUGGER.md sections 18/20, so rebase after whichever lands first. #40 (stdin) is closed and landed.

This epic is waiting on its steps. next: waiting (#405 in implementation)

[loop:torbscript] decided by the loop: #42 is an epic and gets no `ready` itself. Section 4 plus the C back end (a `#line` per block only, `Statement` ignored by `backend/c/body.trb`, `torb build` never lowers for debugging, `-g` only through the profile's `debugInformation`) make four steps; each is one PR, the next is filed only when the previous lands: - [ ] #405 native build: a `#line` per statement of a debugged lowering, `torb build --debug` (`-O0 -g`), DWARF line-table gate (ready) - [ ] layout table the emitter writes, and the gdb (Python) and lldb (formatter) pretty printers for `torb_text`, `torb_list`, `torb_map` and the program's layouts - [ ] `torb debug` launches `lldb-dap` or `gdb --interpreter=dap` for a native program, translates `s12_count` to `count` in `variables`; a session in `tests/debug/` - [ ] docs (`torb-debug.md`, editor guide) and the VS Code launch for a native program; DEBUGGER.md sections 4, 18, 20 Why these decisions: the design record fixes the options (section 4 chose gdb/lldb behind DAP, not a second adapter), so no owner question. Adapter choice for step 3: `lldb-dap` if found, else `gdb --interpreter=dap` (gdb 14+); the CI gate runs on linux-x64 only and is measured first (is a debugger installed on the runner image; if not, the image gains it in a PR of its own, no runner change). Platform scope: the debugger session test is linux-x64; macOS and Windows are checked by the line-table gate only. Ordering: independent of #403 (task threads) and #39 (evaluate); all three touch DEBUGGER.md sections 18/20, so rebase after whichever lands first. #40 (stdin) is closed and landed. This epic is waiting on its steps. next: waiting (#405 in implementation)
Author
Collaborator

[loop:torbscript] refine: split into steps, #405 is ready. Tokens used for this refine: about 90k. next: waiting (epic waits on its steps, #405 first)

[loop:torbscript] refine: split into steps, #405 is ready. Tokens used for this refine: about 90k. next: waiting (epic waits on its steps, #405 first)
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261024 until 2026-10-24T09:10:00Z

[loop:torbscript] claim refine by session:loop-torbscript-20261024 until 2026-10-24T09:10:00Z
Author
Collaborator

[loop:torbscript] decided by the loop: step 1 (#405) landed on main (PR #408, merge commit 2442b1c45, DEBUGGER.md slice 7 Done, tools/debug-lines.sh present). The epic's remaining list is re-cut: step 2 = layout table the emitter writes plus the gdb (Python) pretty printers (#469); the lldb formatters move to their own step 3 because they reuse the same table and one PR with both would exceed two commits; then torb debug for a native program; then docs and editor launch. Why: the design record fixes the options (section 4), so no owner question; gdb first because its Python API is scriptable in a batch gate, and whether gdb is on the CI runner image is measured in the PR, not asked.

[loop:torbscript] decided by the loop: step 1 (#405) landed on main (PR #408, merge commit 2442b1c45, DEBUGGER.md slice 7 Done, `tools/debug-lines.sh` present). The epic's remaining list is re-cut: step 2 = layout table the emitter writes plus the gdb (Python) pretty printers (#469); the lldb formatters move to their own step 3 because they reuse the same table and one PR with both would exceed two commits; then `torb debug` for a native program; then docs and editor launch. Why: the design record fixes the options (section 4), so no owner question; gdb first because its Python API is scriptable in a batch gate, and whether gdb is on the CI runner image is measured in the PR, not asked.
Author
Collaborator

[loop:torbscript] refine: step 2 filed as #469 and marked ready, next: waiting (epic waits on its steps, #469 next). Tokens used: about 60k

[loop:torbscript] refine: step 2 filed as #469 and marked ready, next: waiting (epic waits on its steps, #469 next). Tokens used: about 60k
Author
Collaborator

[loop:torbscript] refine: step 2 (#469, PR #471) merged 2026-10-24; step 3 filed as #600 (lldb formatters, ready), next: waiting (epic waits on its steps, #600 next)

[loop:torbscript] refine: step 2 (#469, PR #471) merged 2026-10-24; step 3 filed as #600 (lldb formatters, ready), next: waiting (epic waits on its steps, #600 next)
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-29T17:56Z: step 3 (#600) is claimed by an implementer and PR #601 is open. Nothing else to do on the epic.
next: waiting (epic; step 3 is #600, PR #601 in review)

[loop:torbscript] refine: re-checked 2026-10-29T17:56Z: step 3 (#600) is claimed by an implementer and PR #601 is open. Nothing else to do on the epic. next: waiting (epic; step 3 is #600, PR #601 in review)
Sign in to join this conversation.
No labels
loop
ready
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#42
No description provided.