Skip to content

DAP: Jump to Value Source on a value of an earlier stop sends that stop's location reference #2177

Done

Description

@lagergren

What happens

"Jump to Value Source" (#2172) on a value from an earlier stop of the program sends the valueLocationReference of
that stop. An example is the result in the Evaluate dialog, which stays open across a step.

DAP gives a location reference the lifetime of a variablesReference: it is valid only until the program resumes.
After a step, the debug adapter:

  • either answers locations with an error, which LSP4IJ reports as "Cannot locate the source of the value of '…'";
  • or, if it numbers the references of the new stop the same way, answers the location of another value. The editor then
    opens a wrong place.

Cause

DAPJumpToValueSourceAction
is enabled whenever the session is suspended, at any stop, and sends the value's reference with DAPClient.locations
as it is.

Set Value had the same problem for an Evaluate result after a step, and #2150 fixed it there: DAPValueModifier and
DAPExpressionModifier send their request with DAPClient.sendInExecutionEpoch(value.getStackFrame().getExecutionEpoch(), …).
That refuses a request whose stop has ended, and Set Value then says "The program has run since this value was shown:
show it again to set it." #2172's description lists using it for locations as a follow-up.

Expected

Jump to Value Source on a value of an earlier stop sends no locations request. It says why it can't jump, in the
same way as Set Value, e.g. "The program has run since this value was shown: show it again to jump to the source of
its value."

How it could be done

  • In jumpToValueSource, send the request with
    client.sendInExecutionEpoch(value.getStackFrame().getExecutionEpoch(), () -> client.locations(reference)), and report
    the refusal with a DAPBundle message.
  • Optionally, also disable the action in update for a value whose stop has ended, if the epoch can be read cheaply
    there.

Test

In DAPJumpToValueSourceSessionTest:

  • evaluate an expression whose result has a valueLocationReference;
  • step;
  • run the action on the kept result.

Expect no locations request, and the message. A value of the current stop still jumps.

Related: #2115, #2172, #2150.

Activity

  1. added this to the 0.30.2 milestone on Nov 24, 2026
  2. added
    bug
    dap
    on Nov 24, 2026
  3. added a commit that references this issue on Nov 24, 2026
    a860b93
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

    bugdap

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions