Open kenzieschmoll opened 5 years ago
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?
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.
Could we add support in the VM for disabling a single breakpoint or is that out of the question?
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
DWDS should be able to enable and disable breakpoints with minor effort. We do that for hot restarts for example.
We have been getting internal requests for this feature. We should prioritize this for Q2.
SGTM. Creating a tracking issue in the SDK for the service work: https://github.com/dart-lang/sdk/issues/45336.
Support has landed in the VM service in https://github.com/dart-lang/sdk/commit/2a2d83e9e9f2e5770da18966c35716f44a8bcbd2.
@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.
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.