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
{{ message }}
Repository navigation
Running Flutter apps with Ctrl+F5 still hits breakpoints #340
When we run Dart apps, we don't send --enable-vm-service if the user invokes using Ctrl+F5 (start without debugging).
For flutter, this does not disable the debugging service so we still hit breakpoints. Passing --release results in:
Release mode is not supported for emulators.
We could skip attaching to Observatory but it feels a little inconsistent with how the Dart one runs (no observatory, rather than just not attaching to it).
I'm not really sure why release mode is forbidden on emulators - @devoncarew - looks like this was done here. Any details on why? Do you think "not attaching to observatory" is the best fix here, or should flutter have a no-debugger way of launching on an emulator?
In IntelliJ, we chose to map the non-debug run mode to flutter run --debug (Flutter's --profile and --release modes didn't seem to match up well with what we wanted). We just don't send any breakpoints in run mode.
In case it's helpful:
the --debug and --profile modes both run with the service protocol enabled (--profile doesn't allow debugging, but does allow profiling)
the --profile and --release modes are both AOT compiled
If you will connect Observatory but just don't send breakpoints, I presume it'll still break on an exception. Do you think this is reasonable/expected? If not, I could just skip connecting instead?
Ok, for now I'll think I'll do that. We'll connect observatory normally (though without pause-on-start) and additionally upon connection skip sending breakpoints and set the exception behaviour to not break (I'm assuming the default is to break; I didn't actually test it yet). Thanks!
I decided to fix this by not connecting to Observatory (even though it's running). Doing the other way ended up with lots of ifs littered around (don't send initialise for flutter when starting up, having to start-paused so that I can set exception break mode before an exception can occur, not sending breakpoints or exception mode when VS Code sends them).
Seems to work fine; and when an exception occurs it still gets spat out to the console (and obviously is visible in the app's red screen!).
Activity
DanTup commentedon Jul 2, 2017
When we run Dart apps, we don't send
--enable-vm-serviceif the user invokes using Ctrl+F5 (start without debugging).For flutter, this does not disable the debugging service so we still hit breakpoints. Passing
--releaseresults in:We could skip attaching to Observatory but it feels a little inconsistent with how the Dart one runs (no observatory, rather than just not attaching to it).
I'm not really sure why release mode is forbidden on emulators - @devoncarew - looks like this was done here. Any details on why? Do you think "not attaching to observatory" is the best fix here, or should flutter have a no-debugger way of launching on an emulator?
devoncarew commentedon Jul 3, 2017
In IntelliJ, we chose to map the non-debug run mode to
flutter run --debug(Flutter's--profileand--releasemodes didn't seem to match up well with what we wanted). We just don't send any breakpoints in run mode.In case it's helpful:
DanTup commentedon Jul 3, 2017
If you will connect Observatory but just don't send breakpoints, I presume it'll still break on an exception. Do you think this is reasonable/expected? If not, I could just skip connecting instead?
DanTup commentedon Jul 3, 2017
(or I could change expecting pause mode, though it's starting to seem a bit clunky!)
devoncarew commentedon Jul 3, 2017
Yes, actually we had a recent bug report about that; I do think you want to toggle the setting to not break on exceptions.
DanTup commentedon Jul 3, 2017
Ok, for now I'll think I'll do that. We'll connect observatory normally (though without pause-on-start) and additionally upon connection skip sending breakpoints and set the exception behaviour to not break (I'm assuming the default is to break; I didn't actually test it yet). Thanks!
DanTup commentedon Jul 7, 2017
I decided to fix this by not connecting to Observatory (even though it's running). Doing the other way ended up with lots of
ifs littered around (don't send initialise for flutter when starting up, having to start-paused so that I can set exception break mode before an exception can occur, not sending breakpoints or exception mode when VS Code sends them).Seems to work fine; and when an exception occurs it still gets spat out to the console (and obviously is visible in the app's red screen!).