-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[debug] Is StackTraceResponse.totalFrames truly necessary? #31851
Comments
Valid question. We will discuss this... @isidorn you don't need this, right? |
Yes that is correct. However keep in mind the following case: I am fine with this corner case, but just to be aware of it. |
And if anyone does care, you could ask for 21 frames, but display 20. |
@weinand do we want to do something here? Assigning to November and debt so we discuss. |
Any plans for this? I'm trying to optimise something too, and knowing the full count of frames is more expensive than not. Including a boolean in the response to say the frame list was truncated is another way around the issue described above (to avoid asking for one more than required and letting the DA do it however it sees fit). |
I noticed that VS Code updates its count from The only niggle is that the expand text says "Fetch all stack frames" when it only fetches the next batch - however it does render nicely and provide the fetch link again on the next round trip. So potentially this issue could be resolved by just documenting this (that a client should always use the latest (I may ship this anyway, understanding it may break and need updating/reverting, as the gains from not having to compute the full stack length up-front can be significant in some scenarios). |
I agree, we should relax the need for So the only remaining option is to document how the current properties and capabilities can be used in a way that results in the desired behavior. First let's describe the behavior observed in VS Code:
After fixing the found issues from above the "observed behaviour" could be considered a "valid and useful interpretation" of the spec. We only have to improve the descriptions of the affected properties in the DAP spec so that the "interpretation" becomes more "apparent". @isidorn and @DanTup what do you think? I've added the 4 variations to Mock Debug: microsoft/vscode-mock-debug@0090320 |
Makes sense to me. If we decide to go down this route, feel free to create a new issue and assign to me so I can look into fixing this issues. |
I've created microsoft/debug-adapter-protocol#162 with a proposal for improving the descriptions of the DAP I've created these issues:
|
The description of
supportsDelayedStackTraceLoading
debug adapter capability stipulates that in order for delayed stack loading to work, the adapter must populate thetotalFrames
field ofStackTraceResponse
.However, for native debuggers, this value is not so easy to compute. For example, when FPO (frame pointer omission) optimization is in play, the debugger may need to load debug info for all modules currently on stack, even those at the very bottom which the user probably didn't care about.
Since the total number of frames is never surfaced in the UI, I am wondering whether
totalFrames
is truly necessary. Wouldn't VSCode know that it has reached bottom of the stack when it receives back less frames than thelevels
it requested?The text was updated successfully, but these errors were encountered: