views:

28

answers:

1

Working on some linux (Ubuntu) systems, running some in-house C and C++ apps (gcc).

There is a long list of signals which are handled, such as SIGSEGV and SIGINT. On signal, the callstack is obtained using backtrace(3) and backgrace_symbols(3). For C++ the function names are even demangled with abi::__cxa_demangle().

My question is: when these signals come up, what other C/C++ API is there which would give us more useful information to log for debugging after-the-fact? Or is the backtrace the only 'sexy' thing to do?

+1  A: 

You may want to enable core dumps... ulimit -c unlimited or similar. Then you can load the core file into GDB and see what happened to the program.

Jonathan
Thank you, yes, that is one of the things we currently do on some installations.
Stéphane