debugger: debug native programs #42
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#42
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Section 4 describes debugging a native build.
Source
Acceptance criteria
torb debug, sets breakpoints on TorbScript lines, steps, and reads variables by their source names with formatted values (steps 4a to 5)Steps (epic: no
readyon this issue)#lineper statement of a debugged lowering,torb build --debug- #405 (PR #408)torb debuglauncheslldb-daporgdb --interpreter=dapfor a native program and relays DAP; the printer scripts ship in the package; a session intests/debug-native/- #720 (landed as PR #723)variables(s12_counttocount) and a session that reads variables - #731 (landed as PR #732)torb-debug.md, the editor guide) and the VS Code launch for a native program; DEBUGGER.md sections 4, 18 and 20 - #739 (landed as PR #762)Dependencies
None known.
Moved from the planning lists of the docs; the design record stays the specification.
[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] 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] claim refine by session:loop-torbscript-20261023 until 2026-10-23T03:39:59Z
[loop:torbscript] decided by the loop: #42 is an epic and gets no
readyitself. Section 4 plus the C back end (a#lineper block only,Statementignored bybackend/c/body.trb,torb buildnever lowers for debugging,-gonly through the profile'sdebugInformation) make four steps; each is one PR, the next is filed only when the previous lands:#lineper statement of a debugged lowering,torb build --debug(-O0 -g), DWARF line-table gate (ready)torb_text,torb_list,torb_mapand the program's layoutstorb debuglauncheslldb-daporgdb --interpreter=dapfor a native program, translatess12_counttocountinvariables; a session intests/debug/torb-debug.md, editor guide) and the VS Code launch for a native program; DEBUGGER.md sections 4, 18, 20Why 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-dapif found, elsegdb --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] 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] claim refine by session:loop-torbscript-20261024 until 2026-10-24T09:10:00Z
[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.shpresent). 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; thentorb debugfor 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] 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 (#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: 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] re-sweep: wrote the steps into the body; they lived only in the refine comments. Steps 1 to 3 (#405, #469, #600) have landed and are ticked; step 4 is due now, just in time, and is not filed yet.
[loop:torbscript] claim refine by session:loop-torbscript-20261112 until 2026-11-12T20:45:00Z
[loop:torbscript] decided by the loop: step 4 is cut in two, and step 4a is filed as #720 (ready). Why: launching the native debugger and relaying DAP (build
--debug, findlldb-daporgdb14+, load the step 2 and 3 scripts, relay and renumber, a session) is one PR of two commits; translatings12_counttocountinvariablesplus its own session is a second, and a session pinned in 4a would otherwise be re-pinned at once. 4b is filed when 4a lands (just in time).Further decisions, so the implementer need not ask:
native: truenext toprogram(section 16 gets the row); the adapter builds withtorb build --debugitself, so the editor needs no build task.lldb-dapfirst (the tier B image already installslldb), elsegdb --interpreter=dap;$TORB_DEBUG_NATIVEforces one. Whetherlldb-dapis on the runner image is measured in the PR, not asked; if not, the workflow'spackages:line gains it.tools/debug-native.shwithtests/debug-native/, not atests/debug/session:tools/debug.sh(tier A) writes all requests at once, which a real debugger cannot answer, and it needs a C compiler and a debugger. Linux only; macOS and Windows keep the line-table gate.tools/today andtools/package.shdoes not ship them, so an installedtorbcould not load them. 4a adds them to the package layout. This is a gap found in this refine, not in the design record.compiler/src/debugger/only, no syntax, native, driver flag or looked-up std name.[loop:torbscript] refine: epic kept without
ready(steps 1 to 3 landed); step 4 cut into 4a (#720, ready) and 4b (filed when 4a lands); epic body updated. Tokens used for this refine: about 70k. next: waiting (epic waits on its steps, #720 next)[loop:torbscript] refine: step 4a is #720 with PR #723 open (forge CI pending, review requested from argus); step 4b is filed when 4a lands. Nothing to do on the epic itself.
next: waiting (step 4a #720, PR #723 in review)
[loop:torbscript] claim refine by session:loop-torbscript-20261113 until 2026-11-13T06:45:00Z
[loop:torbscript] refine: step 4a (#720, PR #723) landed on main 2026-11-13T04:11Z; ticked in the epic body. Step 4b filed as #731 and marked ready: translate
s<digits>_<name>to<name>in the relay ofvariablesresponses (puresourceNameOfinnative.trb, unit-tested), plus an extendedtests/debug-native/session that reads the variables, pinned for lldb and gdb. One PR, two commits. Seed impact: none. Design record: DEBUGGER.md sections 4 and 20. Out of scope: evaluate/setVariable names and the docs/VS Code launch (step 5). No duplicate found among open issues. Epic kept withoutready.next: waiting (step 4b, #731)
[loop:torbscript] release refine: done
[loop:torbscript] wait: step 4b is #731, implementation in PR #732 (CI running); the next step of this epic is filed after it merges.
next: waiting (PR #732 CI and merge gate)
[loop:torbscript] refine: step 4b (#731) landed on main with PR #732 (merged 2026-11-13T09:34Z); ticked in the epic body. The last step, 5 (docs, editor guide, VS Code launch for a native program), is filed by the next refine worker when a slot is free, next: waiting (no worker slot free this tick)
[loop:torbscript] claim refine by session:loop-torbscript-20261113 until 2026-11-13T12:34:00Z
[loop:torbscript] refine: step 5 filed as #739 (ready), next: waiting (step 5 is #739, implement)
[loop:torbscript] wait: step 5 (#739) has PR #762 open, forge CI queued since 16:38Z (head
26bb8f13), merge gate not yet reached, next: waiting (CI on PR #762, then review) until 2026-11-14T08:00:00Z[loop:torbscript] refine: all steps landed (4a #723, 4b #732, 5 #739 as PR #762, merged with argus approval, CI green). Criteria ticked, closing as done. next: done