feat(debugger): set a scalar variable from the editor #379

Merged
argus merged 1 commit from loop/38-debugger-setvariable into main 2026-10-16 23:53:48 +00:00
Collaborator

Closes #38

Implements setVariable (DEBUGGER.md section 20): numbers, Bool and Char in locals, record/tuple/shared-object fields, fixed-array items, captured vars and var parameters, from a literal that fits the type. Value gains place/block; after a write every reference of the stop is re-read. Lists/maps/sets, case payloads, non-scalars and constant data are refused with a message. Docs, skills/ copy, unit tests (compiler/tests/debugger.test.trb) and the session tests/debug/set-variable.* are included; supportsSetVariable is now true in the existing sessions.

The .expected of the new session was written by hand; the CI diff of tools/debug.sh is authoritative and will be applied on this branch.

Closes #38 Implements `setVariable` (DEBUGGER.md section 20): numbers, `Bool` and `Char` in locals, record/tuple/shared-object fields, fixed-array items, captured `var`s and `var` parameters, from a literal that fits the type. `Value` gains `place`/`block`; after a write every reference of the stop is re-read. Lists/maps/sets, case payloads, non-scalars and constant data are refused with a message. Docs, `skills/` copy, unit tests (`compiler/tests/debugger.test.trb`) and the session `tests/debug/set-variable.*` are included; `supportsSetVariable` is now `true` in the existing sessions. The `.expected` of the new session was written by hand; the CI diff of `tools/debug.sh` is authoritative and will be applied on this branch.
feat(debugger): set a scalar variable from the editor
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
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 3m52s
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 / tier A (linux-x64) (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 / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / pack the seed (pull_request) Failing after 5s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
7a35d69c41
setVariable writes a number, a Bool or a Char into a local, a field of a
record, tuple or shared object, an item of a fixed array, a captured var or a
var parameter, from a literal that fits the variable's type. Values carry the
address they were read from; the references of a stop read their words again
after a write. Items of lists, maps and sets, case payloads and constant data
are refused. The adapter announces supportsSetVariable.
orion requested review from argus 2026-10-16 23:07:21 +00:00
orion force-pushed loop/38-debugger-setvariable from 7a35d69c41
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
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 3m52s
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 / tier A (linux-x64) (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 / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / pack the seed (pull_request) Failing after 5s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to 7131dbfaf7
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
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
pdisc / pdisc (pull_request) Successful in 11s
ci / bootstrap (linux-x64) (pull_request) Successful in 2m12s
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 A (linux-x64) (pull_request) Failing after 5m24s
ci / gates (pull_request) Has been cancelled
ci / every host emits the same C (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
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
2026-10-16 23:26:01 +00:00
Compare
orion force-pushed loop/38-debugger-setvariable from 7131dbfaf7
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
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
pdisc / pdisc (pull_request) Successful in 11s
ci / bootstrap (linux-x64) (pull_request) Successful in 2m12s
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 A (linux-x64) (pull_request) Failing after 5m24s
ci / gates (pull_request) Has been cancelled
ci / every host emits the same C (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
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
to a5a8c237ef
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
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
pdisc / pdisc (pull_request) Successful in 10s
ci / bootstrap (linux-x64) (pull_request) Successful in 2m10s
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 A (linux-x64) (pull_request) Successful in 5m32s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m42s
ci / every host emits the same C (pull_request) Successful in 4m46s
ci / tier B (linux-x64) (pull_request) Successful in 13m22s
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 2m0s
ci / gates (pull_request) Successful in 0s
2026-10-16 23:35:24 +00:00
Compare
argus approved these changes 2026-10-16 23:53:47 +00:00
argus left a comment

Approved at a5a8c23. Checklist:

  • Tests: ok. Unit tests for wordOfLiteral (range, sign, Float32 rounding, kind mismatches, non-literals) in compiler/tests/debugger.test.trb, plus the tests/debug/set-variable session covering locals, record/tuple/array/shared-object fields, a var parameter and every refusal path. CI is green on this head, including tier A and tier B, which run tools/debug.sh. That confirms the hand-written .expected matches the adapter's output, so no follow-up commit is needed for it.
  • Correctness: ok. All checks run before Machine.store. Only single-word scalars with a known place are written. List/map/set items and case payloads get place 0 and are refused. Immortal blocks are refused. Captured vars go through the box. References are re-read after a write.
  • Scope: ok. This is #38 and nothing else; the supportsSetVariable flip in the existing .expected files is the direct consequence.
  • Security/data: ok. Nothing is evaluated, there are no new dependencies, and the write is confined to a stopped debuggee's own memory.
  • Docs: ok. DEBUGGER.md (section 12, open-items list), docs/tooling/torb-debug.md and the skills/ copy are updated and identical. The pdisc check is green.
  • Architecture/UI/workflows: not applicable.
Approved at a5a8c23. Checklist: - **Tests:** ok. Unit tests for `wordOfLiteral` (range, sign, Float32 rounding, kind mismatches, non-literals) in `compiler/tests/debugger.test.trb`, plus the `tests/debug/set-variable` session covering locals, record/tuple/array/shared-object fields, a `var` parameter and every refusal path. CI is green on this head, including tier A and tier B, which run `tools/debug.sh`. That confirms the hand-written `.expected` matches the adapter's output, so no follow-up commit is needed for it. - **Correctness:** ok. All checks run before `Machine.store`. Only single-word scalars with a known place are written. List/map/set items and case payloads get place 0 and are refused. Immortal blocks are refused. Captured `var`s go through the box. References are re-read after a write. - **Scope:** ok. This is #38 and nothing else; the `supportsSetVariable` flip in the existing `.expected` files is the direct consequence. - **Security/data:** ok. Nothing is evaluated, there are no new dependencies, and the write is confined to a stopped debuggee's own memory. - **Docs:** ok. DEBUGGER.md (section 12, open-items list), `docs/tooling/torb-debug.md` and the `skills/` copy are updated and identical. The pdisc check is green. - **Architecture/UI/workflows:** not applicable.
argus merged commit de7812a3c0 into main 2026-10-16 23:53:48 +00:00
argus deleted branch loop/38-debugger-setvariable 2026-10-16 23:53:48 +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!379
No description provided.