-
Notifications
You must be signed in to change notification settings - Fork 219
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
Guidance needed on "evaluate" Request #1355
Comments
What frame do you want your expression evaluated in? Ideally VS Code would expose a way to obtain the current frame. I opened an issue on them long ago, but it is still active: microsoft/vscode#63943 |
Hello, @gregg-miskelly I am looking for answers/guidance myself. No one right answer given I have gdb as the debugger. The letter/spirit of the DAP says, to evaluate in the global scope. Not sure how to do that in gdb though (maybe I missed that)
Wouldn't that be nice :-) I wanted an event that clients could subscribe to. The Watch/Variable windows always evaluate according to the selected frame. I just wanted the same luxury for other clients In the end, I want to see if we can figure out together what |
I don't think there is a way to both make this work in VS Code (until microsoft/vscode#63943 is fixed) and also strictly adhere to the DAP. I think there are two possible paths forward:
|
AFAIK, this would be inaccurate and seem random as the scopes request is not repeated and users can jump around, so not clear which frame it would be after a while. I was thinking that if the frameId is missing, we could always apply the request to top frame of the stopped-thread-id. At least that would be consistent. I can volunteer to try and submit a PR for microsoft/vscode#63943 but its likelihood of getting accepted is pretty low don't you think? It's been there since 2018. We always get referred back to using the tracker mechanism. |
If they don't repeat |
@gregg-miskelly I can positively confirm that the scopes is cached by VSCode and only called once. So, there is not much to hang our hat on. Neither of us are honouring the DAP spec for an undefined frameId and it will remain so.
I will close this Issue and and get it out of your queue. |
I am trying to figure out how best to evaluate expressions as a client and what to do with
frameId
during an evaluateAccording to the DAP, if
frameId
is undefined, then means global scopeIf
frameId
is undefined, I get this and the debug session actually ends/hangs (as in not much works afterward and the only thing that works is Ending the session) -- that should be a separate issue.Yes, I can make a request for a stackTrace and then use any one of the frameId's, but that is extra, unnecessary work for clients.
Note that I am using the context as
hover
as I wasn't sure which one would be more appropriate. Should I be using something else? I am using this for memory views and RTOS views discussed hereWe ourselves end up using the current scope when no frameId is specified. But with a warning which we are thinking of removing. I do not know how to specify global scope in gdb machine interface. We know current-scope could be anything depending on what transpired before.
I want us to provide some compatible interface on how to deal with outliers. Please let me know what we should do and I can duplicate that in my DA
Cc: @benmcmorran
The text was updated successfully, but these errors were encountered: