You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an issue around breakpoints / hot restart when working on Cider debugging (a "phantom" breakpoint was being hit after hot restart, need to do more investigation to figure out how it got into that state).
However, I've noticed we have another hot restart / breakpoint issue in DevTools:
Add a breakpoint (e.g., at line 100)
Edit the file so that the breakpoint line should be moved (e.g., at 2 lines above so the breakpoint should now be at line 102)
Click "hot restart" from DevTools
The breakpoint is re-established at line 100, not line 102
Note: the breakpoint is getting re-added at the previous line here:
We've gotten an internal report of phantom breakpoints (this time not when hot restarting an app) and I just hit this myself trying to restart another customer's app.
Along with not re-establishing breakpoints on hot restart (the debugger tool, e.g. VS Code, DevTools should instead send a request to re-establish the breakpoints after the restart has completed as described here), I also think we should migrate back from using the setBreakpointsByUrl.
The motivation for using setBreakpointsByUrl was that Chrome would try to re-establish breakpoints across multiple page reloads (see #1076 (comment)), but that seems like it is causing more bugs than actually being helpful, because we can get in a state where Chrome still thinks a breakpoint exists even though the debugging tool does not. The debugging tool should always be the source of truth in this case.
There are a few changes that need to be made to resolve this:
Remove the logic to re-establish breakpoints after a hot-restart from DWDS
Add logic to re-establish breakpoints after a hot-restart to DevTools
Implement the VM Service setFlag method for pause_isolates_on_start so that the debugging client can make sure the app is paused while the set breakpoints (this makes sure breakpoints set early in the app's execution path are hit)
Update any code runners to respect the pause_isolates_on_start flag value (e.g. in flutter_toolshere)
Make sure DevTools and any other debugging clients are calling setFlag with pause_isolates_on_start along with requirePermissionsToResume(onPauseReload: true)
Activity
elliette commentedon Oct 17, 2023
Some context links:
elliette commentedon Nov 11, 2023
Note: I have not been able to repro the "phantom breakpoint" outside of that one time.
elliette commentedon Jan 29, 2024
We've gotten an internal report of phantom breakpoints (this time not when hot restarting an app) and I just hit this myself trying to restart another customer's app.
Along with not re-establishing breakpoints on hot restart (the debugger tool, e.g. VS Code, DevTools should instead send a request to re-establish the breakpoints after the restart has completed as described here), I also think we should migrate back from using the
setBreakpointsByUrl.The motivation for using
setBreakpointsByUrlwas that Chrome would try to re-establish breakpoints across multiple page reloads (see #1076 (comment)), but that seems like it is causing more bugs than actually being helpful, because we can get in a state where Chrome still thinks a breakpoint exists even though the debugging tool does not. The debugging tool should always be the source of truth in this case.elliette commentedon Feb 14, 2024
There are a few changes that need to be made to resolve this:
setFlagmethod forpause_isolates_on_startso that the debugging client can make sure the app is paused while the set breakpoints (this makes sure breakpoints set early in the app's execution path are hit)pause_isolates_on_startflag value (e.g. influtter_toolshere)setFlagwithpause_isolates_on_startalong withrequirePermissionsToResume(onPauseReload: true)