Skip to content

Breakpoints should be re-established on hot restarting an app #52794

Closed

Description

@elliette

Breaking this issue out from flutter/devtools#5265

For VM apps, hot-restarting an application causes the breakpoints to disappear. That's because the pre-existing breakpoints aren't set on the isolate we get back from the call to getIsolate.

This isn't affecting web apps. DWDS re-establishes breakpoints here: https://github.com/dart-lang/webdev/blob/8360d50ff889f3c0f817d4d48d3aebd71345cf5d/dwds/lib/src/services/chrome_proxy_service.dart#L280-L283, the VM service should so something similar.

Activity

  1. added
    vm-serviceThe VM Service Protocol, both the specification and its implementation
    on Jun 26, 2023
  2. added
    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
    on Jun 27, 2023
  3. mkustermann commented on Jun 27, 2023

    @mkustermann
    Member
  4. mkustermann commented on Jun 27, 2023

    @mkustermann
    Member

    For VM apps, hot-restarting an application causes the breakpoints to disappear.

    The "restart" functionality isn't part of Dart itself, it's a flutter functionality. But maybe flutter tools could request the list of existing breakpoints, then does restart and then make the same breakpoints again.

  5. a-siva commented on Jun 27, 2023

    @a-siva
    Contributor

    This isn't affecting web apps. DWDS re-establishes breakpoints here: https://github.com/dart-lang/webdev/blob/8360d50ff889f3c0f817d4d48d3aebd71345cf5d/dwds/lib/src/services/chrome_proxy_service.dart#L280-L283, the VM service should so something similar.

    How does DWDS deal with changes to the source that make the previous breakpoint locations incorrect or arbitrary, especially in cases when the source changes are substantial?

  6. a-siva commented on Jun 27, 2023

    @a-siva
    Contributor
  7. elliette commented on Jul 6, 2023

    @elliette
    ContributorAuthor

    DWDS is using the Chrome DevTools Protocol Debugger.setBreakpointByUrl API method, which persists breakpoints across page reloads.

  8. a-siva commented on Jul 6, 2023

    @a-siva
    Contributor

    I don't think it is a good idea for the VM to try and automatically re-establish breakpoints after a hot-restart, the sources could have changed in manner that makes it hard to map existing breakpoints back to appropriate locations in the new source base. The IDE tools (editors) have better context of this should be able to do a better job. As suggested in one of the comments above it probably makes sense for the tools to get the existing breakpoints and then map them to appropriate locations after the changes and re-establish the breakpoints after a restart.

  9. added
    closed-not-plannedClosed as we don't intend to take action on the reported issue
    on Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.closed-not-plannedClosed as we don't intend to take action on the reported issuevm-debuggervm-serviceThe VM Service Protocol, both the specification and its implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions