The same issue has been bothering me for some time as well, but with over 60 breakpoints I don't want to just clear them all. Here are a couple more details that I use.
When debugging, switch from OUTPUT
or TERMINAL
to the DEBUG CONSOLE
. When the invisible breakpoint is hit, gdb tells you what its breakpoint number is. Note that sometimes there are multiple breakpoints in the same location (which you can see by typing -exec info breakpoints
and it will report <MULTIPLE>
). In this case, make sure you -exec delete breakpoint N
and not just the "sub-breakpoint" N.M
, because the others will still trigger it.
Sometimes the breakpoint is hit when the program first starts. In this case, click on each of your active breakpoints in the BREAKPOINTS
panel. If any of them are set on a block of code that is commented out this will cause the program to halt at startup. You can disable or remove this breakpoint from either the GUI panel or from the gutter in the code editor (right-click to select to disable).
I'm still waiting for a solution that prevents the invisible breakpoints from being set again without having to "clear all". For me, the problem (with <MULTIPLE>
breakpoints, anyway) seems to happen when the breakpoints are set in template<T>
logic. This is possibly a bug in the VSCode C++ parser, and may be made worse when you set the breakpoint while the code is currently in a state where it fails to compile.