farre / midas

A GDB/MI Visual Studio Code Debug Adapter
MIT License
29 stars 1 forks source link

Fixes #181 #182

Closed theIDinside closed 8 months ago

theIDinside commented 8 months ago

TLDR; DAP is not good enough, also any "dynamic" removal of breakpoints will not be notified to VSCode.

I've taken an executive decision here with respect to removed breakpoints.

The removal of a breakpoint will not be notified to VSCode going forward, as this breaks with how the Debug Adapter Protocol "knows of" breakpoints.

For instance, in VSCode, one can disable a breakpoint by unchecking the checkbox; this will trigger a new 'breakpoints' request, that does not contain the unchecked breakpoint. But from a protocol perspective, what does this mean? That it was deleted or just disabled? The protocol gives us no way of knowing, unfortunately.

So when the breakpoint is deleted after the request, a notification of "breakpoint removed" is sent to VSCode, and it will delete the breakpoint that was unchecked from it's UI, unfortunately.

This is probably more of a "you problem" for VSCode and or the DAP, than a Midas issue, but this workaround will do.

This workaround however means that any breakpoint removal not done by the user explicitly via the vscode UI (for instance, a breakpoint removed by some Python script), will not be notified to VSCode of. But it's a price I'm willing to pay.