Comments (7)
My suggested documentation: Ids are valid until the next continue. If multiple GotoTargetsRequest
are issued by a client, the debug adapter is allowed, but not required, to return the same id if the underlying execution location is the same between the two requests.
from debug-adapter-protocol.
I am not sure why a client might want to issue multiple gotoTargets
requests, but it also seems wrong not to handle them -- the DAP uses handles in lots of other places, so I don't know why an adapter would do things differently here.
GotoTargetsArguments
doesn't specify a thread id, so I don't think an adapter could actually know which template instantiation to return.
line
in GotoTarget
is useful for the same reason as in breakpoints - the incoming line is where the user requested. But the debug adapter may find that it doesn't have an executable code associated with that line, but it does have executable code associated with lines in close proximity. An IDE could then choose to use that line info in a disambiguation dialog.
FYI: If you are asking about this because you are thinking about implementing this in MIEngine, GotoTargets
needs to call IDebugProgram2.EnumCodeContexts.
from debug-adapter-protocol.
Could someone explain a use-case for doing multiple GotoTargetsRequests in a row?
VSCode just issues 1 targets request and directly feeds the id into the goto request for its Jump to Cursor functionality, ignoring anything else inside the GotoTarget: debugCommands.ts
This adapter already relies on this by returning a dummy GotoTarget with id 1 and the same source line given in the request and then simply remembers the last requested target.
I can barely come up with an example for returning more than 1 target (template functions come to mind but why would it be ambiguous if you are already in the same function) let alone multiple target requests.
Also I don't know what the other GotoTarget fields could be useful for (line? we already requested a specific line).
from debug-adapter-protocol.
I am not sure why a client might want to issue multiple
gotoTargets
requests, but it also seems wrong not to handle them -- the DAP uses handles in lots of other places, so I don't know why an adapter would do things differently here.
I guess confusion about the spec like in this ticket, vscode as the reference implementation does it as described above and it makes the implementation much easier (at least if you assume IDs need to be globally unique, that crucial 'certain IDs are valid only until the next continue' information is buried in some tickets on Github, see #60).
GotoTargetsArguments
doesn't specify a thread id, so I don't think an adapter could actually know which template instantiation to return.
Interesting. Related to #38.
Any other use-case for multiple locations?
line
inGotoTarget
is useful for the same reason as in breakpoints - the incoming line is where the user requested. But the debug adapter may find that it doesn't have an executable code associated with that line, but it does have executable code associated with lines in close proximity.
I see, should be added to the docs.
from debug-adapter-protocol.
Any other use-case for multiple locations?
For compiled languages, I think of the gotoTargets
request as akin to asking: "if I was to set a breakpoint on this line, where would the breakpoint mind?" without actually setting the breakpoint. So you could get multiple answers if:
- The function was compiled multiple times (ex: C++ templates)
- The line was mapped to multiple instruction groups (ex: optimizations, compiler bugs,
for
loops in C-like languages, etc) - The method was included in multiple modules (ex: inline function defined in C/C++ header file)
- Potentially a managed runtime might JIT a method multiple times (ex: fast JIT and optimizing JIT) and expose that
from debug-adapter-protocol.
Yeah it's easy to handle breakpoints as for example gdb just sets 1 per associated address. But jump
will probably fail if it's ambiguous.
from debug-adapter-protocol.
I am not sure why a client might want to issue multiple
gotoTargets
requests
If you want to implement jumping by dragging the current line marker like in VS you'd probably have to do that.
But even then that simple approach of remembering the last request would still work as long as the UI doesn't do caching.
from debug-adapter-protocol.
Related Issues (20)
- Protocol extension points HOT 3
- Lifetime of variableReference after setVariable HOT 3
- Clarify meaning of "system process" HOT 7
- Example on how to launch debug adapter HOT 3
- Standardise the ability for client/DA to use URIs in place of file paths (enabling debugging of non-file:/ sources) HOT 17
- Add additional data fields for breakpoints HOT 11
- Evaluation time out HOT 1
- Clarifications for setExceptionBreakpoints HOT 6
- Ordering of launch, setBreakpoints, and configurationDone HOT 3
- Add a "type" field for SourceBreakpoints HOT 16
- Add a `bytes` range to the DataBreakpointInfo Request HOT 14
- Clarification of the meaning of '?' in a request HOT 1
- Is it always allowed to send requests that control execution? HOT 3
- Proposal: Add new reason `finished` or `stepOut` and optional field `returnValue` to `Stopped Event` HOT 21
- OutputEvent variablesReference lifetime clarification HOT 1
- How does the debugger notify dap client that a breakpoint is disabled? HOT 8
- Proposal: add a document location to the evaluate request for the 'hover' variant. HOT 18
- Help needed : Disassembly a C/C++ frame (function) HOT 2
- Minor inconsistency in "evaluate" description
- Debug Event which is responsible for loading source file in Editor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debug-adapter-protocol.