Repository navigation
Description
Does this issue occur when all extensions are disabled?: Not tested. Reproduced with the Arm Debugger extension in an Extension Development Host; the evidence below captures the state being removed inside VS Code's workbench, rather than a missing debug-adapter event.
- VS Code Version: 1.138.0, commit
7debcd0e2acdea1c52de81bf9ee1620444407dda(Linux snap) - OS Version: Ubuntu 24.04.4 LTS, x86_64; Linux 6.8.0-139-generic
- Debug extension: Arm Debugger 2.0.0 development checkout
- Latest stable / Insiders: Not yet tested. Latest stable is 1.140.0 at reporting time. The affected
stoppedDetailspush/filter logic is also present in upstreammainatd547327fc4b6721ccf340c95b73bd6bffd708a78; this is a source check, not a claim of reproduction on that build.
Steps to reproduce (observed)
- Start a single-thread debug session that initially stops, then resumes and quickly hits an entry-point breakpoint (
mainin our case). - Inspect the Call Stack after the entry-point breakpoint is hit.
- Stop and start the session again if needed; the problem is intermittent.
Expected: The Call Stack shows "Paused on breakpoint" when the target stops at the breakpoint.
Actual: The target is paused at main, and the stack frame/source location are correct, but the Call Stack pause-reason header is absent. There is no subsequent continued event in the failing session.
Captured workbench evidence
These are JSON snapshots from DevTools logpoints in the failing session, in execution order. JSON.stringify was used so these are not lazily evaluated object references.
Immediately before this.stoppedDetails.push(event) in DebugSession.handleStop:
{"point":"stop-before-push","incoming":{"allThreadsStopped":true,"hitBreakpointIds":[1],"preserveFocusHint":false,"reason":"breakpoint","threadId":2},"existing":[{"preserveFocusHint":false,"reason":"stopped","threadId":2}]}Immediately before the continued-event handler's stoppedDetails.filter, with remaining calculated using that same filter:
{"point":"continued-cleanup","threadId":2,"before":[{"preserveFocusHint":false,"reason":"stopped","threadId":2},{"allThreadsStopped":true,"hitBreakpointIds":[1],"preserveFocusHint":false,"reason":"breakpoint","threadId":2}],"remaining":[]}The older continued-event cleanup therefore removes the newer breakpoint-stop record as well as the initial stop record.
Adapter logs independently show this order:
stopped {"preserveFocusHint":false,"reason":"stopped","threadId":2}
continued {"threadId":2}
stopped {"allThreadsStopped":true,"hitBreakpointIds":[1],"preserveFocusHint":false,"reason":"breakpoint","threadId":2}
threads responses: thread 2 is present
stackTrace responses: top frame is main, line 26
Small regression-test scenario (no Arm target required)
The observed ordering suggests this focused test with a fake debug adapter:
- Establish thread 2 and its initial stopped state.
- Deliver
continuedfor thread 2 and let its cleanup be scheduled but not executed yet. - Deliver the breakpoint
stoppedevent above, allowinghandleStopto append the new record. - Allow the earlier continued cleanup to execute before the new stop's asynchronous thread lookup completes; then resolve that lookup with thread 2 and a valid stack frame.
- Assert that the thread is stopped and
session.getStoppedDetails()?.reasonis"breakpoint".
This is a proposed deterministic regression test, not a standalone full-workbench reproduction we have already run. The real-session logpoints above confirm the record-removal ordering.
Relevant source
- Continued cleanup:
debugSession.ts, line 1153 - New stop is recorded before asynchronous thread lookup:
debugSession.ts, line 1353 - Scheduler awaits thread IDs before applying cleanup:
debugSession.ts, line 1634 - Single-thread Call Stack header reads session stop details and hides when absent:
callStackView.ts, line 187
It appears the continued cleanup needs to invalidate only the older stop state, without removing a stop received after that continued event. No raw debugger logs, local file paths, or target binaries are needed to demonstrate the captured state mutation.
Activity
Preserve newer debugger stop details during continued cleanup (#339530)