Digital Paint Discussion Board
Development => General Development => Topic started by: jitspoe on May 22, 2008, 01:41:12 AM
-
So apparently Linux and/or gcc thinks asserts should terminate a program completely instead of just triggering a breakpoint and allowing me to step through it with a debugger. How do I make them behave correctly?
-
I'm not sure about the "right" way to do this but here's a suggestion.
#include <signal.h>
#undef assert
#define assert(expression) \
((void) ((expression) ? 0 : raise(SIGTRAP)))
http://en.wikipedia.org/wiki/SIGTRAP (http://en.wikipedia.org/wiki/SIGTRAP)
-
Thanks - I'll look into that.