Skip to content

Running Flutter apps with Ctrl+F5 still hits breakpoints #340

Closed

Description

@DanTup
No description provided.

Activity

  1. added
    in debugging
    on Jul 2, 2017
  2. DanTup commented on Jul 2, 2017

    @DanTup
    MemberAuthor

    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?

  3. devoncarew commented on Jul 3, 2017

    @devoncarew
    Contributor

    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
  4. DanTup commented on Jul 3, 2017

    @DanTup
    MemberAuthor

    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?

  5. DanTup commented on Jul 3, 2017

    @DanTup
    MemberAuthor

    (or I could change expecting pause mode, though it's starting to seem a bit clunky!)

  6. devoncarew commented on Jul 3, 2017

    @devoncarew
    Contributor

    Yes, actually we had a recent bug report about that; I do think you want to toggle the setting to not break on exceptions.

  7. DanTup commented on Jul 3, 2017

    @DanTup
    MemberAuthor

    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!

  8. added this to the v2.0 milestone on Jul 7, 2017
  9. added
    in flutter
    on Jul 7, 2017
  10. DanTup commented on Jul 7, 2017

    @DanTup
    MemberAuthor

    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!).

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

    in debuggingin flutteris bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions