You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DAP: Jump to Value Source on a value of an earlier stop sends that stop's location reference #2177
"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.
Activity
fix: Jump to Value Source on a value of an earlier stop says so, inst…