debugger: list suspended tasks as DAP threads (step 1 of #41) #403
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
Step 1 of #41 (epic). A debugged program still runs on one worker (DEBUGGER.md section 14); this step makes the tasks visible. Step 2 (the worker pool the debugger can hold) is filed when this lands.
Source
DEBUGGER.md sections 14 and 20
Goal
threadsanswersmainplus one thread per live task;stackTracefor a task thread shows that task's frames (a suspended task: the frame in its task block); the stopped thread is the one the stop happened in.Acceptance criteria
threadslistsmainand every live task, with stable ids across stops (ids of finished tasks are not reused)stackTraceon a task thread returns its frames;variablesandscopeswork for themallThreadsStoppedtests/debug/(.trb+.dap+.expected) with at least two suspended tasks and a breakpoint inside a task bodySeed
Does not touch the seed: no syntax change, no new std name looked up by string. A new debug native (runtime plus VM kernel operation) is added; a seed refresh is not needed unless the debugger sources themselves are in the seed's closure (then the refresh stays Torben's).
Size
One PR, two Conventional Commits:
feat(runtime)the walk and kernel operation,feat(debugger)threads, stackTrace, session test and docs.Dependencies
Likely file overlap with #39 and #40 (both debugger):
compiler/src/debugger/debuggee.trb(request dispatch,threadsat the answer-at-once block) andadapter.trb,tests/debug/, DEBUGGER.md section 20. Rebase after whichever lands first; do not start before #39 and #40 are merged or in review to keep conflicts small.Part of #41.
[loop:torbscript] claim implement by session:loop-torbscript-20261023 until 2026-10-23T06:07:14Z
[loop:torbscript] checkpoint implement: PR #404 is open (branch loop/403-debugger-task-threads, runtime walk + DebugTasks kernel operation + threads/stackTrace per task + tests/debug/tasks + docs). CI is queued; the hand-written tests/debug/tasks.expected may need a correction from the CI diff. Still working on it (claim implement by session:loop-torbscript-20261023).
[loop:torbscript] implement: PR #404 opened (#404), CI green (tier A, tier B, gates, bootstrap) after one fix round (format and the expected output of
tests/debug/tasks), next: reviewthreadslistsmainplus a thread per task of the program that runs, waits, is queued or has not started (task <n>, idn + 1, numbered lazily by the runtime); runtime-made tasks are not listed.DebugTasks(torb_task_walk), a held frame per waiting task read from its block, the stop names its thread,stackTracetakesthreadId.mainempty (documented in DEBUGGER.md section 14). Stepping one thread while the others stand needs a held worker pool, left open in section 20.Tokens: about 2.0M in this implement run (estimate, includes context re-reads).
[loop:torbscript] post-merge: PR #404 merged 2026-10-23 02:09:43Z (merge commit
40164061bd), no 'After merge' section in the PR. No deploy step in the PR; the language repo ships via nightly.yml (last nightly 02:45 UTC). Not yet verified in a nightly build, so the threads/stackTrace per task is merged but not yet live in a release. Acceptance criteria boxes above stay unticked; PR #404 body maps them to the change (walk + DebugTasks, threads/stackTrace per task, tests/debug/tasks, DEBUGGER.md 2/14/20). Next: confirm in the next nightly (tests/debug/tasks in CI on main).