This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
argument values at function return
- From: Roland McGrath <roland at redhat dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Fri, 29 Jul 2005 14:49:35 -0700 (PDT)
- Subject: argument values at function return
> Anil reported that Bert Hubert would like to see arg values upon
> return from a function. Jim pointed out that this would be tough to
> do reliably in kprobes, since the ABIs specify where the args live
> on entry to the function, but not on exit. It could perhaps be done
> in SystemTap, which has access to the debug info.
It's not purely an issue of knowing where to look. The locations where
arguments are passed are available to the callee to reuse. On machines
with register arguments, they always do. On stack-passing machines, they
do at least for tail calls. Simply put, the argument values are not
reliably still stored anywhere at all by function return time. What
systemtap can do, and I would think can be made to do in a mostly automatic
fashion, is to save argument values in a function entry probe and then use
those saved values in an exit probe.