This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: Help using elfutils to get function and line number
- From: Mihai Tarce <mihaitarce at yahoo dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 16 Mar 2009 12:33:34 -0700
- Subject: 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