Skip to content

Provide a VM Service / DDS API for evaluating expressions based on their location #59737

@DanTup

Description

@DanTup

Consider the following code:

var aaa = 1;

f() {
  var aaa = 2;
  debugger();
}

If I stop at debugger() and hover over aaa on the first line, I will see a value of 2 because we always just evaluate the expression in the current frame. It would be nice if we could provide a location and ask for an evaluation at a given location, which automatically handles selecting the right frame based on the hover location.

It would even be nice if we didn't need to provide an expression at all, but just a location, since VS Code often expands to something that is not valid (an API for "evaluate whatever expression is at [location]"), which causes issues for evaluating expressions in parens (see Dart-Code/Dart-Code#5362).

There's some more discussion about this in Dart-Code/Dart-Code#5362

cc @bkonyi @derekxu16

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub teamtype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions