feat(debugger): list suspended tasks as DAP threads #404
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/403-debugger-task-threads"
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?
Closes #403
Task
Step 1 of #41:
threadslists the tasks of the program, andstackTraceanswers per thread.What
torb_task_walk(runtime/task.c) lists the live machine tasks as six-word records (serial, block, state, waits-on, frame, bits). A task gets its serial the first time a walk lists it, so ids are stable and never reused. New kernel operationDebugTasks(88), mirrored informat.trbandmachine.c.Debugger.runningTask/taskBeloware set around the scheduler's resume inanswer(), so a stop inside a task body splits the task's frames from the main thread's.threadsanswersmain(id 1) andtask <n>(id n+1) for every task that runs, waits or has not started.stackTracehonoursthreadId; a waiting task has one frame at itsawait()statement with locals read from the task block (StackFrame.held).stoppednames the thread of the running task. Frame ids are unique across the threads of one stop.continuestill act on the stopped position (all threads stand together); stepping one thread needs a held worker pool, which stays in DEBUGGER.md section 20.tests/debug/tasks(two tasks thatpause, breakpoint in the body, threads and stacks at two stops).Seed
No seed refresh needed: no syntax, std-name or driver-flag change, only a new debug kernel operation.
Test
No local
torbor C compiler in the sandbox; the gates run in this PR's CI. The new.expectedwas written by hand and is corrected from the CI diff if needed.Checklist for
e19fa8c:tests/debug/taskscovers threads, stacks per thread, an unknown thread, locals of a waiting task and a second stop; CI green on this head (gates, tier A/B, bootstrap, pdisc).torb_task_walkreads under the tree lock and only the machine's own tasks (torb_machine_resume); serials are never reused;DebugTasksis capacity-checked and re-queried when more tasks exist.runningTask/taskBeloware saved and restored around the resume. Frames are allocated at task creation, soheldFramereads a valid block for unstarted tasks.Non-blocking: none.