8000 Add an option to disable breakpoints without removing them by LyViolz · Pull Request #10080 · flutter/devtools · GitHub
[go: up one dir, main page]

Skip to content

Add an option to disable breakpoints without removing them - #10080

Draft
LyViolz wants to merge 1 commit into
flutter:masterfrom
LyViolz:disable-breakpoints
Draft

LyViolz wants to merge 1 commit into
flutter:masterfrom
LyViolz:disable-breakpoints

Conversation

@LyViolz
@LyViolz LyViolz commented Nov 9, 2026 •
Copy link
Copy Markdown

Fixes #696

Adds a checkbox to each breakpoint in the Breakpoints pane, so that a breakpoint can be turned off without removing it, like in Chrome DevTools. The checkbox calls the VM service setBreakpointState RPC. That RPC landed in dart-lang/sdk@2a2d83e, but DevTools never used it.

  • BreakpointManager.setBreakpointEnabled calls setBreakpointState. The VM replies with a BreakpointUpdated event, and DevTools now uses that event to update breakpointsWithLocation.
  • Disabled breakpoints are drawn in a muted color, both in the list and in the gutter.
  • A disabled breakpoint stays disabled when breakpoints are re-established after a hot reload or a hot restart.
  • The checkbox is hidden for Dart web apps, because DWDS throws UnimplementedError for setBreakpointState (pkg/dwds/lib/src/services/proxy_service.dart).
  • The BreakpointResolved handler changed the list held by the ValueNotifier in place and then assigned the same list back, so listeners were not notified. It now builds a new list. BreakpointUpdated uses the same code path, and the new breakpoint_manager_te 8000 st.dart fails without this change.

Screenshots (DevTools built from this branch, connected to a small Dart CLI app):

Before After
Before: breakpoints have no checkbox After: the breakpoint on line 5 is unchecked

Before: both breakpoints are enabled and the isolate pauses on line 5. After: the breakpoint on line 5 is unchecked, so it is drawn in a muted color in the list and in the gutter. The isolate skips it and pauses on line 6.

Manual verification: DevTools was built from this branch with flutter build web --release and connected to a Dart CLI app. Two breakpoints were added from the gutter and one was unchecked in the Breakpoints pane. getIsolate then reported that breakpoint as enabled: false, and after resuming, the isolate skipped it and paused on the next breakpoint. Checking the box again re-enabled the breakpoint. Not checked by hand: keeping the disabled state across a Flutter hot restart, and the hidden checkbox for web apps, which is covered by a widget test.

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

Each breakpoint in the Breakpoints pane now has a checkbox that calls the
VM service's setBreakpointState RPC. Disabled breakpoints stay listed, are
drawn in a muted color in the list and in the gutter, and stay disabled when
breakpoints are re-established after a hot reload or hot restart.

The checkbox is hidden for Dart web apps, because DWDS does not implement
setBreakpointState.

The BreakpointResolved handler now builds a new list instead of mutating the
existing one in place, so that the ValueNotifier notifies its listeners. The
new BreakpointUpdated handling shares this code path.

Fixes flutter#696

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Debugger FR] Add option to disable breakpoints

1 participant

0