[dtrace-discuss] Re: invalid address (0x0) in action #2 at DIF offset 52

Jeremy Harris jgh at wizmail.org
Sat Jan 20 06:00:12 PST 2007


Madhusudhan Reddy wrote:
> Gonzalo,
> If iam not wrong, input arguments of the function are arg0,arg1, arg2..... and return arguments are arg1, arg2, arg3.....

A "C" function has only one (or zero) return arguments; supplied in a "return" statement.

> 
> 3rd Input argument  of SGetMsg(which is pointer to a pointer) is of my interest so iam trying to print this value using arg3 when the function returns. Anything wrong ?

A "C" function can't change it's caller's view of an input argument either.  What you
might be asking for (I'm not clear, from your question) is the value pointed to
by the third input argument, at the time of return from the function.

If so, you should do something like capturing that 3rd input argument on entry
to the function (in one D clause) and indirecting through the captured pointer
on exit from the function (in a separate D clause).

- Jeremy


More information about the dtrace-discuss mailing list