-
Notifications
You must be signed in to change notification settings - Fork 319
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
Can not set a breakpoint on an if statement with only a boolean variable in DevTools #3289
Comments
Hi @kenzieschmoll, I would like to ask your attention to this issue. I filled the issue 26 days ago and it seems to get lost or forgotten. At this point, I experienced this issue above again while debugging my own code and thought that it might be a good idea to write this reminder. Thanks. |
@bkonyi looks like we are grabbing the breakable positions here:
|
It looks like we're missing a |
with simple boolean conditions Fixes flutter/devtools#3289 TEST=runtime/observatory/tests/service/breakpoint_on_simple_conditions_test.dart Change-Id: I5ed0b78b4e462615d0d0c7dff1581b38dcf00aee Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213421 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
Fixed in dart-lang/sdk@c51f885. |
It is not possible to set a breakpoint on an if statement with only a boolean variable.
Android Studio lets you set a breakpoint, but it will not get hit the first time. The second time the breakpoint is passed, it breaks a few lines further in the code.
DevTools does not allow to set a breakpoint.
Especially with Android Studio, this is confusing, because it looks like the code where the breakpoint is, is not executed.
I suggests two fixes:
Sample project can be found here:
https://github.com/jsroest/breakpoint_bug
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale en-NL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.56.2)
[✓] Connected device (2 available)
Sample here in Android Studio:
The breakpoint is skipped on the first button press and hits somewhere below on the second button press.
Screen.Recording.2021-08-18.at.11.53.47.mov
Related issues:
flutter/flutter#88306
flutter/flutter#81051 (comment)
The text was updated successfully, but these errors were encountered: