This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help using elfutils to get function and line number


 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


      

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]