debugger: docs, editor guide and VS Code launch for a native program (step 5 of #42) #739

Closed
opened 2026-11-13 11:15:15 +00:00 by orion · 4 comments
Collaborator

Context

Epic #42, last step (5). Steps 1 to 4b are on main: torb build --debug, the layout table and the gdb and lldb printers, torb debug with native: true (relay to lldb-dap or gdb --interpreter=dap), and the source names in variables. What is missing is the editor side and the closing of the design record. docs/tooling/torb-debug.md already has a section "A native program" and docs/design/DEBUGGER.md section 16 lists the native attribute, but the VS Code extension cannot launch one: editors/vscode/package.json (contributes.debuggers) has no native attribute in its launch schema, no initial configuration and no snippet for it, and docs/how-to/set-up-your-editor.md (step 6) describes the VM only.

Source

  • docs/design/DEBUGGER.md section 4 (native programs), section 17 (VS Code), section 18 (slices), section 20 (Open, "Native programs")
  • docs/tooling/torb-debug.md, section "A native program"
  • compiler/src/debugger/native.trb (adapter lookup, $TORB_DEBUG_NATIVE), tests/debug-native/

Requirements

  1. The launch schema in editors/vscode/package.json (contributes.debuggers[0].configurationAttributes.launch.properties) shall contain native (boolean, default false, description: build program with torb build --debug and debug the binary in lldb-dap or gdb; test, filter, console, justMyCode, noDebug, report do not apply).
  2. contributes.debuggers[0].configurationSnippets shall contain "TorbScript: Debug a Native Program" (program, native: true), and initialConfigurations shall contain "Debug Native File" ("program": "${file}", "native": true).
  3. The DebugConfigurationProvider in editors/vscode/debugging.js shall keep native: true through resolve, and shall refuse native together with test with an error message that names both attributes.
  4. docs/how-to/set-up-your-editor.md shall have, in or right after step 6, a paragraph "Debug a native program": the launch.json with native: true, that it needs lldb-dap or gdb 14 or later on the path (and $TORB_DEBUG_NATIVE), that variables show their TorbScript names and formatted values, and which attributes do not apply. The "Full example" section shall show one such launch.json entry.
  5. docs/tooling/torb-debug.md shall be checked against compiler/src/debugger/native.trb and tests/debug-native/, and any difference (adapter order, error messages, printers shipped in the package) corrected; its native row and the editor guide shall link each other.
  6. docs/design/DEBUGGER.md shall be updated: section 17 names the native configuration, section 18 gets slice 12 (step 5, Done), the header and section 20 no longer list native programs as open, and section 4's "built later" wording says what is built.
  7. The epic's acceptance criterion in #42 holds when this lands; the PR body says so (Closes #N, Refs #42).

Done when

  • package.json is valid JSON and its launch schema, snippets and initial configurations contain the native entries of requirements 1 and 2 (node -e 'JSON.parse(require("fs").readFileSync("editors/vscode/package.json"))').
  • The extension's tests under editors/vscode/ (if the directory has them; add one for requirement 3 where a test file for debugging.js exists) pass in forge CI.
  • docs/how-to/set-up-your-editor.md and docs/tooling/torb-debug.md mention native consistently; the doc checks of tools/gates.sh (links, doctests, regenerated skills/) are green in forge CI.
  • docs/design/DEBUGGER.md section 20 has no open native item, and grep -n "native" docs/design/DEBUGGER.md shows slice 12 in section 18.
  • tools/check-commits.sh is clean (one or two Conventional Commits, for example feat(vscode): launch a native program and docs: native debugging in the editor guide).

Notes

  • Touches no seed, no syntax, no native and no driver flag. Docs and extension only; no build or gate run by the worker, forge CI reads them.
  • Marketplace or Open VSX publishing is out of scope (releases stay Torben's).
  • Model hint: sonnet, medium.
## Context Epic #42, last step (5). Steps 1 to 4b are on `main`: `torb build --debug`, the layout table and the gdb and lldb printers, `torb debug` with `native: true` (relay to `lldb-dap` or `gdb --interpreter=dap`), and the source names in `variables`. What is missing is the editor side and the closing of the design record. `docs/tooling/torb-debug.md` already has a section "A native program" and `docs/design/DEBUGGER.md` section 16 lists the `native` attribute, but the VS Code extension cannot launch one: `editors/vscode/package.json` (`contributes.debuggers`) has no `native` attribute in its launch schema, no initial configuration and no snippet for it, and `docs/how-to/set-up-your-editor.md` (step 6) describes the VM only. ## Source - `docs/design/DEBUGGER.md` section 4 (native programs), section 17 (VS Code), section 18 (slices), section 20 (Open, "Native programs") - `docs/tooling/torb-debug.md`, section "A native program" - `compiler/src/debugger/native.trb` (adapter lookup, `$TORB_DEBUG_NATIVE`), `tests/debug-native/` ## Requirements 1. The launch schema in `editors/vscode/package.json` (`contributes.debuggers[0].configurationAttributes.launch.properties`) shall contain `native` (boolean, default `false`, description: build `program` with `torb build --debug` and debug the binary in lldb-dap or gdb; `test`, `filter`, `console`, `justMyCode`, `noDebug`, `report` do not apply). 2. `contributes.debuggers[0].configurationSnippets` shall contain "TorbScript: Debug a Native Program" (`program`, `native: true`), and `initialConfigurations` shall contain "Debug Native File" (`"program": "${file}"`, `"native": true`). 3. The `DebugConfigurationProvider` in `editors/vscode/debugging.js` shall keep `native: true` through `resolve`, and shall refuse `native` together with `test` with an error message that names both attributes. 4. `docs/how-to/set-up-your-editor.md` shall have, in or right after step 6, a paragraph "Debug a native program": the `launch.json` with `native: true`, that it needs `lldb-dap` or gdb 14 or later on the path (and `$TORB_DEBUG_NATIVE`), that variables show their TorbScript names and formatted values, and which attributes do not apply. The "Full example" section shall show one such `launch.json` entry. 5. `docs/tooling/torb-debug.md` shall be checked against `compiler/src/debugger/native.trb` and `tests/debug-native/`, and any difference (adapter order, error messages, printers shipped in the package) corrected; its `native` row and the editor guide shall link each other. 6. `docs/design/DEBUGGER.md` shall be updated: section 17 names the native configuration, section 18 gets slice 12 (step 5, Done), the header and section 20 no longer list native programs as open, and section 4's "built later" wording says what is built. 7. The epic's acceptance criterion in #42 holds when this lands; the PR body says so (`Closes #N`, `Refs #42`). ## Done when - [ ] `package.json` is valid JSON and its launch schema, snippets and initial configurations contain the `native` entries of requirements 1 and 2 (`node -e 'JSON.parse(require("fs").readFileSync("editors/vscode/package.json"))'`). - [ ] The extension's tests under `editors/vscode/` (if the directory has them; add one for requirement 3 where a test file for `debugging.js` exists) pass in forge CI. - [ ] `docs/how-to/set-up-your-editor.md` and `docs/tooling/torb-debug.md` mention `native` consistently; the doc checks of `tools/gates.sh` (links, doctests, regenerated `skills/`) are green in forge CI. - [ ] `docs/design/DEBUGGER.md` section 20 has no open native item, and `grep -n "native" docs/design/DEBUGGER.md` shows slice 12 in section 18. - [ ] `tools/check-commits.sh` is clean (one or two Conventional Commits, for example `feat(vscode): launch a native program` and `docs: native debugging in the editor guide`). ## Notes - Touches no seed, no syntax, no native and no driver flag. Docs and extension only; no build or gate run by the worker, forge CI reads them. - Marketplace or Open VSX publishing is out of scope (releases stay Torben's). - Model hint: sonnet, medium.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T22:40:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T22:40:00Z
Author
Collaborator

[loop:torbscript] implement: PR #762 open, CI pending (forge runner queue, runs waiting since 16:38Z, branch loop/739-debug-native-docs, head 26bb8f13e0), next: waiting (forge runner queue). Remaining: CI result; check that torb docs skill --check accepts the hand-applied skills copies.

[loop:torbscript] implement: PR #762 open, CI pending (forge runner queue, runs waiting since 16:38Z, branch loop/739-debug-native-docs, head 26bb8f13e0b9), next: waiting (forge runner queue). Remaining: CI result; check that `torb docs skill --check` accepts the hand-applied skills copies.
Author
Collaborator

[loop:torbscript] release implement: PR #762 open, CI pending in runner queue

[loop:torbscript] release implement: PR #762 open, CI pending in runner queue
argus closed this issue 2026-11-13 19:18:53 +00:00
Author
Collaborator

PR #762 (merge 1211173a1) is on main; #739 was closed by its Closes trailer. No 'After merge' steps. Merged code is in no release: the repo has no v-tag and no chore(release) commit yet. Next step, not done in this turn: cut the first stable release (version-bump PR to project.trb, compiler/project.trb, editors/vscode/package.json and compiler/src/package/version.trb, reviewer argus, then tag v0.MINOR.PATCH per release.yml). Docs and the VS Code extension are in source only until then; the edge site rebuilds from main.

PR #762 (merge 1211173a1) is on main; #739 was closed by its Closes trailer. No 'After merge' steps. Merged code is in no release: the repo has no v-tag and no chore(release) commit yet. Next step, not done in this turn: cut the first stable release (version-bump PR to project.trb, compiler/project.trb, editors/vscode/package.json and compiler/src/package/version.trb, reviewer argus, then tag v0.MINOR.PATCH per release.yml). Docs and the VS Code extension are in source only until then; the edge site rebuilds from main.
Sign in to join this conversation.
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#739
No description provided.