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: Frank Ch. Eigler <fche at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 16 Mar 2009 15:57:59 -0400
- Subject: Re: Help using elfutils to get function and line number
Hi -
> 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. [...]
(We're not quite there yet, but this sort of thing will be pretty
easy to express with systemtap, as in ...)
# inject a fault
probe process("/lib/libc.so.6").function("fread_unlocked").return { $fp->_flags |= 4 }
# print the backtrace
probe process("/lib/libc.so.6").function("fclose") { print_backtrace() }
- FChE