Wednesday, June 9, 2010

Debugging with gdb - catching asserts

Note to self.

When gdb encounters a failing assert in your source code the program is aborted (SIGABRT) and you’re sometimes left with nothing...?
Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
(gdb)
Not really. Its just hiding in another thread.

(gdb) info thread

will tell you where to find it. A simple issue of thread # switches context and gets your precious stack back. You can also configure gdb to handle signals as described here.

No comments:

Post a Comment