Fix paused debug status and pause/step hangs; bump extension to 2.4.1 - #158
Merged
Merged
Conversation
Handle source-less and empty-stack stops, discard stale execution snapshots, and bump the extension to 2.4.1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Extension Build Successful!📦 VSIX artifact is ready for download Scroll down to the "Artifacts" section and download To install: In VS Code, run |
Recognize a new stopped event independently of frame IDs, source locations, or stack availability in both VS Code and CLI execution snapshots. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e8c76249-e4b9-47a4-adee-0ef91ec3f978
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pause_executionidempotent for an already-stopped target; running targets still receive pause and wait for stopped/terminated state.Fixes #157. Related source-less-frame work: #149 (not merged or closed by this PR).
Root cause
Paused detection previously depended on readable source location, and pause reused navigation logic that waited for a different snapshot even when the target was already stopped. Merely switching to frame/thread IDs is insufficient: Cortex-Debug can emit
stoppedfollowed by a successful emptystackTraceresponse. Its upstream stack-query error path preserves that empty response while stopped: implementation.The new read-only observer keeps execution state separate from frame availability. It handles thread-specific/all-thread transitions, clears session state on termination, and suppresses stale UI frames after continued events. Sessions predating observation retain a frame-context fallback; a bare selected thread is not treated as proof of a stop. Startup readiness still requires actionable frame context (or the existing attach success condition), and no frame identifiers or source data are invented.
Reproduction and validation
npm run compile, targeted ESLint, andnpm run packagepass.The empty-stack case uses a controlled inline DAP adapter matching the verified Cortex-Debug response sequence, not physical microcontroller hardware. This reproduces the reported status/pause/manual-step behavior but does not establish the reporter's exact underlying GDB failure.
Step-over follow-up
The reporter's follow-up described
step_overremaining pending until manual Step Into. We reproduced this through real VS Code/MCP with a controlled DAP adapter: a completed step emitted a freshstoppedevent but kept the same source/frame metadata, or continued to have no usable source/stack. Navigation compared snapshots rather than recognizing that new stop.The fix carries an internal stopped-event sequence into both executors' snapshots. A fresh stop completes stepping independently of frame/source availability; a resume or UI-only change does not. Selected-thread sequences are unaffected by other threads' partial transitions. Unobserved sessions retain the compatibility fallback, and no new field is exposed in tool JSON.
Added regressions cover step-over/into/out, stops without a preceding continued event, unchanged and missing context, thread scope, snapshot lifecycle, running transitions, termination, and the CLI's real DAP request/event path. The original seven live status/pause scenarios still pass, alongside eight follow-up scenarios including repeated real Node steps and restart controls.
This is an isolated controlled-adapter reproduction, not physical microcontroller hardware. The separate restart hang was not reproduced and is not claimed fixed by this update.
Integration and scope
origin/maininto this branch; it was already up to date at63386060586e2c887a89bab26f9d6ada49a960cd.step_into/step_outreport incorrectcurrentLineandcurrentLineContent#82), stepping into methods (step_into silently degrades to step_over after any step-triggered stop — stackTrace not requested on reason: "step" stopped events #71), and breakpoints not firing (Breakpoints set via MCP API don't pause execution (using custom stdio proxy) #123) are not established as fixed and are left open.