Skip to content

[dev_compiler] Some locations are missing from the source map #48874

@annagrin

Description

@annagrin

Some locations are missing from the source map, causing stack frames being displayed on a wrong line in Chrome DevTools or Dart DevTools.

Repro

In the following example, pause at the breakpoint and step into the call, then click on a frame that calls the top frame.

void main() {
    printObjectMultiLine();
}

void printObjectMultiLine() {
  print( // Breakpoint
    createEnclosingObject()
      ..initialize(),
  );
}

MyClass createEnclosingObject() {
  return EnclosingClass();
}

class MyClass {
  MyClass();

  void initialize() {}
}

Expected

Debugger is pointing at line stating at the createObject

Actual

Debugger is pointing at line stating at the print

Details

Note the locations that are printed (by adding debug print in dwds) when trying to hover over a variable in the second from the top frame. There seem to be no location in source map for createObject().

image

JavaScript call stack in chrome devtools (line 198 corresponds to 197 in the printout above)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions