Comments (6)
I personally find the ‘put the return value in the scopes’ to be a hack that’s only sporadically implemented and not intuitive for users. I would like to offer a better ui to my users.
The obvious UI for this is to inline it as an inlay hint or virtual test next to or around the function call. This is not trivial and I don’t think there’s enough info in the proposal for clients to implement that well.
In order for this to work well we would need it whether the user pressed step out or step over etc. (Parity with the ‘scopes’ approach). It could be enough just to provide a variablesReference and sourceReference/line number or something.
In summary I think it would be a good addition, but needs more iteration on the UI side to decide what data are worthwhile.
Alternatively, a statement that “typically the return value from the last function call should be reported as a Scope named ‘return’” might help with consistency for users.
from debug-adapter-protocol.
Alternatively, a statement that “typically the return value from the last function call should be reported as a Scope named ‘return’” might help with consistency for users.
This would definitely be an improvement -- for my gdb implementation, I was completely unaware that this was a convention.
Adding a variable reference to the stop event also seems reasonable to me.
Alternatively I suppose an adapter could also do this via an output event. (Though again, the key thing is to document any such convention.)
from debug-adapter-protocol.
Output event is very bad. Probably not even visible to user in most cases.
from debug-adapter-protocol.
The purpose of the step
reason is to disambiguate the reason if an event interrupts a step that the client previously sent. For example, if I step over an instruction but have a data breakpoint that's hit before we'd normally pause on the next instruction. In cases where step
is given as the reason, the client will already know in which direction the step happened, so I'm not sure the value in specifying beyond that.
For the return value, the way most DA's do this today is adding the return value to the first scope when the return value is present, for example in VS Code's Python debugger:
If we have an explicit DAP-level return value, is there a better experience you envision that clients would want to implement?
from debug-adapter-protocol.
I guess this work just as well.
I suppose one way my proposed way would be preferred, is if in some universe, someone decides to log return values from a function (or set of functions). Automating this process would probably be easier if a "return value" was standardized in the protocol from stepOut, but even in that universe, that functionality could be solved using the same approach as you mentioned.
So I guess we can close this issue really.
from debug-adapter-protocol.
Hm, nothing in particular comes to mind for usages of it in VS Code's UI (cc @roblourens) but let's leave it open for a bit to see if any other client implementors want to weigh in.
In general DAP is a protocol for specifying what UI should be available during debugging, so most of our thinking starts at the client experience we want to build, and from there the minimal protocol necessary to describe it.
from debug-adapter-protocol.
Related Issues (20)
- Extend `StackFrame` to support longer description than `name` HOT 2
- Does `setBreakpoints` trigger multiple `breakpoint` events? HOT 2
- 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
- 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 16
- Help needed : Disassembly a C/C++ frame (function) 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.