This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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: Forw: [ahoole at islandnet dot com: Accessing a va_list element from a probe]


Hi -

> I was wondering if you have ever attempted to access a va_list from a probe
> in user-space.  I can access the arguments; however, I'm presently puzzled
> as to how to elegantly access the individual items of the va_list.  [...]
>
> According to stap -L we have the following arguments available:
> # stap -L 'process("/lib64/libc-2.17.so").function("printf")'
> process("/usr/lib64/libc-2.17.so").function("__printf@/usr/src/debug/glibc-2
> .17-c758a686/stdio-common/printf.c:28") $format:char const* $arg:va_list
> $done:int

My guess is that one way to do this would be a tapset function kind of
like tokenize(), where some internal state is kept from call to call
(the va_list pointer), and consecutive varargs are fetched off of the
stack, based upon types & sizes, with user_long() etc.  It'd have to
reimplement gcc __builtin_va_arg, which is not THAT bad, but a bit of
work.

- FChE


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