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

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

Closed
elliette opened this issue Jun 26, 2023 · 6 comments
Closed

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

elliette opened this issue Jun 26, 2023 · 6 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-not-planned Closed as we don't intend to take action on the reported issue vm-debugger vm-service The VM Service Protocol, both the specification and its implementation

Comments

@elliette
Copy link
Contributor

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.

@elliette elliette added the vm-service The VM Service Protocol, both the specification and its implementation label Jun 26, 2023
@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jun 27, 2023
@mkustermann
Copy link
Member

/cc @aam @rmacnak-google

@mkustermann
Copy link
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.

@a-siva
Copy link
Contributor

a-siva commented Jun 27, 2023

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?

@a-siva
Copy link
Contributor

a-siva commented Jun 27, 2023

//cc @derekxu16

@elliette
Copy link
Contributor Author

elliette commented Jul 6, 2023

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

@a-siva
Copy link
Contributor

a-siva commented Jul 6, 2023

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.

@a-siva a-siva added the closed-not-planned Closed as we don't intend to take action on the reported issue label Jul 6, 2023
@a-siva a-siva closed this as completed Jul 6, 2023
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, and the AOT and JIT backends. closed-not-planned Closed as we don't intend to take action on the reported issue vm-debugger vm-service The VM Service Protocol, both the specification and its implementation
Projects
None yet
Development

No branches or pull requests

4 participants