Skip to content

start_debugging should carry location and note when it answers a stop; get_stack_trace as the other carrier of the stale-build note (#950 follow-up) #951

Closed

Description

@debugmcpdev

Summary

#950 extends the stale-build warning to the compiled languages, but for them the artefact is known only once the launch has been transformed, so nothing can be said before start_debugging. The first chance is therefore a stop answer — and the most common agent flow for a fast program never reads one that carries it:

set_breakpoint        → no launch yet: the echo stands alone
start_debugging       → answers `paused, reason: breakpoint` with no `location` and no `note`
get_stack_trace       → carries no note
get_local_variables   → carries no note

Measured on the dev proxy with the .NET and Java fixtures while verifying #950: the start_debugging answer for a breakpoint reached during the launch has no location slot (the #823 launch-answer shape), so describeStaleBuild is never asked. Only wait_for_stop on the already-paused session, step_*, pause_execution, or a second set_breakpoint after the launch surface the sentence.

Proposal

  1. start_debugging carries location (and the note describeStaleBuild adds) when it answers a stop, the way wait_for_stop does — one describeStopLocation read on the launch answer's paused arm.
  2. get_stack_trace appends the same note when the top frame's file binds through a stale artefact: it is the other natural carrier, and the one the fast-program flow always calls.

Until then the natives' first chance is wait_for_stop; docs/tool-reference.md and the Java/.NET guides name the carriers.

Refs #950, #938, #823.

Activity

  1. debugmcpdev commented on Oct 19, 2026

    @debugmcpdev
    CollaboratorAuthor

    Shipped in #960.

    Both proposals, as filed:

    1. start_debugging (and restart_debugging, which replays a launch) carries location, context, and threadId/note when it answers a stop, the way wait_for_stop does — one describeStopLocation read on the launch answer's PAUSED arm (an auto-continued entry stop never reaches it: the readiness wait's microtask re-read, wait_for_stop: block until a session's next stop or end instead of polling list_debug_sessions #849, sees the RUNNING the continue sets). location and threadId sit at the top level and in data; context and the full note at the top level. The launch message is unchanged.
    2. get_stack_trace appends the same stale-build sentence when the file of its top frame is newer than the compiled file the debugger binds it through — the top frame only, and not a <…> label, a relative spelling or an unresolvedSource frame. The same openable-path rule now gates the line read and the stale probe on every stop answer.

    Measured on the dev proxy (Windows, aged dotnet.dll, breakpoint in Program.cs):

    call before after
    start_debugging (paused at the breakpoint) data.reason: "breakpoint", nothing else top-level location (Program.cs:8), context, note naming the DLL and the source with both mtimes
    get_stack_trace no note the same note
    wait_for_stop (control) the note the note
    after dotnet build, relaunch — location + context, no note, on both
    Python stopOnEntry launch (control) — location (hello.py:1) + context, no note

    So the fast-program flow set_breakpoint → start_debugging → get_stack_trace → get_local_variables now sees the sentence twice where it saw it zero times.

    Also in the PR: the three identical hoist-plus-stale-check blocks in execution-tools.ts (step, wait_for_stop, pause_execution) became one helper, hoistStopLanding, which the two launch handlers call as well; the start_debugging and get_stack_trace tool descriptions name the new fields; the seven doc pages that said "(#951)" now name the carriers.

    CI-run proof with a real adapter: the #823 case in tests/integration/javascript-launch-config.test.ts asserts the launch answer's location.line and context at the line-9 breakpoint. The Java/.NET/C++/JavaScript e2e aging cases assert the launch carrier (.NET, JavaScript — the fixtures that are paused when the launch answers) and the get_stack_trace carrier (all four); those files run on no CI lane.

    Not done here, deliberately: lastStop on the launch answer (reason is there; wait_for_stop and get_stack_trace carry the record); the launch message wording; a note on get_local_variables/get_variables; an unresolvedSource flag on location itself (an absolute path behind a sourceReference is still probed — a probe of a file that exists here is a fair one).

    Side finding while measuring: #959 (a .NET launch without dapLaunchArgs.program passes the .cs to netcoredbg and fails with a bare 0x800700c1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions