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


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

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