Skip to content
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

[VM Service Protocol] Support lazily computing bound variables for frames #43827

Open
grouma opened this issue Oct 16, 2020 · 4 comments
Open
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P3 A lower priority bug or feature request pkg-vm-service triaged Issue has been triaged by sub team

Comments

@grouma
Copy link
Member

grouma commented Oct 16, 2020

The VM Service protocol requires all bound variables to be computed for a frame. Each bound variable, for web debugging, potentially requires an evaluation in Chrome to compute which introduces latency. However, VS Code supports lazily displaying bound variables when a user selects a given frame in the stack. We should modify the VM Service protocol to support this lazy computation. We can either introduce a new call like boundVariablesFor(Frame) or introduce the concept of a boundVariableRef.

@grouma
Copy link
Member Author

grouma commented Oct 16, 2020

Related to dart-lang/webdev#993 and #43826

@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. pkg-vm-service labels Oct 19, 2020
@bkonyi
Copy link
Contributor

bkonyi commented Feb 19, 2021

As proposed by @jacob314 offline:

A simpler way to provide this API could be to provide one version of the getStackTrace API that does not specify any bound variables. The field is already optional in Frame.

@devoncarew
Copy link
Member

OK, I see the definition of getStack() here: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getstack. The proposal is to add something like an optional don'tPopulateVariables parameter to the call?

How would users go from an unpopulated Frame (https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#frame) then to one populated with bound variables? Would the getObject() call return a populated frame? I see that Frame is a Response, and doesn't have an object ID.

cc @jacob314 @bkonyi @grouma

@jacob314
Copy link
Member

The simplest solution is getStack could have a starting frame index as well as an ending frame index which matches what other debugger protocols support. Adding a frameId would also be reasonable and the debugger adapter protocol supports both. Both would be easy enough for dwds to support.

@bkonyi bkonyi added P3 A lower priority bug or feature request triaged Issue has been triaged by sub team labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P3 A lower priority bug or feature request pkg-vm-service triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

5 participants