I need to get the information provided by addr2line (source file and line from backtracing a function call) from within a C++ program.
I know I can call addr2line directly as a subprocess and I know that I can copy the source code of addr2line into my program (which is also GPL licensed). But the code looks complicated and I don't feel comfortable using it directly. What does bfd
mean, anyway? I would prefer to use some function in the C++ STL library, because that would be cleaner.
I am working in a Linux environment.
bfd
is the en.wikipedia.org/wiki/Binary_File_Descriptor_library (although originally it stood for the other meaning of BFD :) – Primaverasltrace
, but you might not want to link against bfd directly yourself: lists.debian.org/debian-devel/2005/05/msg01086.html – Offhand