On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?
-
On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?
@bagder libbacktrace by Ian Lance Taylor -
@bagder libbacktrace by Ian Lance Taylor@bagder it directly parses DWARF and can (though, that relies on UB) work from the signal handler.
Plus it's not really that platform specifics as uses unwinder from C++ (that _Unwind_Backtrace call) -
On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?
I'm proceeding with libbacktrace (https://github.com/ianlancetaylor/libbacktrace) - there is also a package already in Debian. Seems do to the job for me just fine.
Thanks everyone!
-
I'm proceeding with libbacktrace (https://github.com/ianlancetaylor/libbacktrace) - there is also a package already in Debian. Seems do to the job for me just fine.
Thanks everyone!
@bagder forgot to tell you, keep in mind it might not be built the way you want. Plus GCC includes the static build of it and it's possible to accidentally link with what it includes. -
@bagder forgot to tell you, keep in mind it might not be built the way you want. Plus GCC includes the static build of it and it's possible to accidentally link with what it includes.
-
@bagder ok then, good