Open grouma opened 4 years ago
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.
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
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.
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.