2

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?

4

1 回答 1

1

您可能希望启用核心转储...ulimit -c unlimited或类似功能。然后你可以将核心文件加载到 GDB 中,看看程序发生了什么。

于 2010-10-27T13:27:37.600 回答