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
[Debugger FR] Add option to disable breakpoints #696
It would be nice to have an option to disable breakpoints, similar to chrome devtools. I was running into this today when trying to look at another page (Memory), but I stopped being able to interact with my app because I hit a breakpoint in the debugger. In this case, being able to disable breakpoints without having to remove them would be useful.
I started to look into implementing this feature and as I've gotten further into it, I think this functionality would be better at the dds layer. The workflow for disabling breakpoints would be to cache existing breakpoints, remove them as far as the vm is concerned, and then upon reactivating them, re-add the breakpoints from the cached list. If a bp is added or removed while breakpoints are deactivated, that breakpoint should be added or removed from the cached list.
Then from devtools we could simply call service.setBreakpointsActive(false). @bkonyi@grouma thoughts?
Since the VM doesn't have support for disabling a single breakpoint, we'd have to remove them and add them back at a later point. This would involve creating a new ID scheme for breakpoints in DDS since the breakpoint ID would change each time it was reestablished.
We'd need an entirely new set of breakpoint RPCs in DDS to intercept the existing ones to handle this. It's not trivial work.
I did some digging and it looks like we do have the ability to enable/disable breakpoints within the VM, but that functionality isn't exposed. This shouldn't be too hard to add to the protocol, but we should make sure DWDS won't have issues implementing enableBreakpoint and disableBreakpoint RPCs. cc/ @grouma
@elliette do you continue to see this request from internal users? Looks like the changes are in place on the VM side to use this but we never hooked it up in DevTools.
Activity
kenzieschmoll commentedon Feb 11, 2021
I started to look into implementing this feature and as I've gotten further into it, I think this functionality would be better at the dds layer. The workflow for disabling breakpoints would be to cache existing breakpoints, remove them as far as the vm is concerned, and then upon reactivating them, re-add the breakpoints from the cached list. If a bp is added or removed while breakpoints are deactivated, that breakpoint should be added or removed from the cached list.
Then from devtools we could simply call
service.setBreakpointsActive(false). @bkonyi @grouma thoughts?bkonyi commentedon Feb 11, 2021
From chat:
Since the VM doesn't have support for disabling a single breakpoint, we'd have to remove them and add them back at a later point. This would involve creating a new ID scheme for breakpoints in DDS since the breakpoint ID would change each time it was reestablished.
We'd need an entirely new set of breakpoint RPCs in DDS to intercept the existing ones to handle this. It's not trivial work.
kenzieschmoll commentedon Feb 11, 2021
Could we add support in the VM for disabling a single breakpoint or is that out of the question?
bkonyi commentedon Feb 11, 2021
I did some digging and it looks like we do have the ability to enable/disable breakpoints within the VM, but that functionality isn't exposed. This shouldn't be too hard to add to the protocol, but we should make sure DWDS won't have issues implementing
enableBreakpointanddisableBreakpointRPCs. cc/ @groumagrouma commentedon Feb 11, 2021
DWDS should be able to enable and disable breakpoints with minor effort. We do that for hot restarts for example.
grouma commentedon Mar 16, 2021
We have been getting internal requests for this feature. We should prioritize this for Q2.
bkonyi commentedon Mar 16, 2021
SGTM. Creating a tracking issue in the SDK for the service work: dart-lang/sdk#45336.
bkonyi commentedon Apr 6, 2021
Support has landed in the VM service in dart-lang/sdk@2a2d83e.
kenzieschmoll commentedon May 26, 2023
@elliette do you continue to see this request from internal users? Looks like the changes are in place on the VM side to use this but we never hooked it up in DevTools.