While developing a plugin I tried to use the debugging facilities offered by CB, including
cbAssert(). What I found is that this function, when the assertion fails, it is supposed to terminate the application (in this case Code::Blocks) but on Linux it terminates all my processes, forcing a new login.
This behavior seems to be caused by the macro
DIE, which is called after the assertion message is outputted. The macro is defined in this way, in the file
cbexception.h.
#ifdef __WXMSW__
#define DIE() exit(1)
#else
#include <csignal>
#define DIE() kill(0, SIGTERM)
#endif
According to the
kill() function documentation, sending a signal to pid 0 means:
If pid is 0, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the process group ID of the sender, and for which the process has permission to send a signal.I guess this macro should send the signal only to the calling process, not to every process having the same group ID. Am I wrong?
As a side note, it would be nice to have the CB assert functions, on Linux, show a message dialog too, like they do on Windows. Currently wxSafeShowMessage() shows a message box only on Windows, while it simply prints the message on the standard output on Linux. This could be accomplished adding an optional call to wxMessageBox() instead of wxSafeShowMessage().
Regards, XayC