How to crash the debugger plugin / C::B:
Open a project, set a breakpoint, start debugging
Edit the breakpoint, add a condition with a symbol that does not exist
Now a message box pops up asking you whether you want to convert the breakpoint into an unconditional one
Kill gdb
Click on either the yes or no button of the popup dialog
Watch the fireworks.
What happens is the following:
Gdb outputs a string saying it doesn't like the condition
OnGDBOutput is called
ParseOutput is called
the cbMessageBox is opened deeply down the call stack of ParseOutput
Now cbMessageBox apparently starts to handle events
gdb terminating causes an event that causes OnGDBTerminated to be called
OnGDBTerminated deallocates the debugger driver (even though code of the debugger driver still runs)
I haven't had an easy + somewhat clean idea on how to fix this... In the end I removed HasDriver, but added LockDriver and UnlockDriver. LockDriver still returns a value indicating whether there is a driver, but if there is, also increments a use counter. Terminate then does not deallocate the driver, but only sets a flag. UnlockDriver then decrements the use counter, and if it reaches zero, checks the terminate flag and does the deallocation if the flag is set. All calls to m_State.GetDriver() need to be surrounded with LockDriver() and UnlockDriver(). Also, there needs to be some buffering to prevent ParseOutput to be reentered...
Is it worth fixing? Dunno. It was definitely unexpected when I hacked the code...