|
From: Nicholas N. <nj...@ca...> - 2004-01-03 17:54:34
|
On Tue, 23 Dec 2003, Nicholas Seow wrote:
> I've been trying to get a valgrind skin i'm tinkering with to get a
> program to report whenever it calls or returns from a function. However,
> I'm getting some really wierd data.
I've attached a tool (skin) I wrote, called Sparrow, that does exactly
this. Here's some example output:
call _init
call __init_misc
call strrchr
exit strrchr
exit __init_misc
call __libc_global_ctors
call _IO_check_libio
exit _IO_check_libio
exit __libc_global_ctors
exit _init
Unfortunately, it falls over sometimes. The reason is, I maintain a stack
of activation records, and if the function returned from doesn't match
that on the top, it dies. Actually, I do some fiddling with %esp which
catches many uses of longjmp, but not all.
Generally, this function entry/exit tracking is a total pain, much harder
than you'd expect. Anyway, it might be useful for you.
N |