Help using elfutils to get function and line number

Mihai Tarce mihaitarce at yahoo.com
Mon Mar 16 19:33:34 UTC 2009


 I am trying to implement a library which substitutes libc (using LD_PRELOAD),
in order to be able to inject errors into programs under test making standard
library calls (e.g. fopen, malloc, etc.). I would like to log the backtrace when such
a call is made, to see the execution path which lead to the error.

backtrace_symbols() only works if the main program was compiled with -rdynamic,
which is not always the case, so I need to read the file names and line numbers
from the debug information in the files.

Thank you for all the prompt replies, I'll look at the eu-addr2line implementation.

Mihai


      


More information about the elfutils-devel mailing list