views:

214

answers:

1

I want to install a SIGSEGV and friends handler in C++ to print a stack trace and exit on a crash.

backtrace_symbols_fd from glibc is almost what I want, but it doesn't symbolize calls in anonymous namespaces. However, gdb deals with that just fine (I have symbols compiled in, DWARF etc).

What library would you recommend for my situation?

+1  A: 

Have you looked at abi::__cxa_demangle - this should correctly demangle the output from backtrace_symbols.

Dave Rigby
Thanks, but it's not the point. I can live with a mangled symbol name - but for anonymous namespace I get *no* symbol name! That's the problem.
phjr