[dtrace-discuss] values from a struct

James Carlson
2010-09-17T12:16:06Z

On 09/17/10 07:40, goinsane wrote:
> Helle Krishnan,
>
> thank you! I thought it''s not possible to store an address of a
struct.
> Do you know how to extract the current size of the struct?
>>From accept(3socket):
>
>  "   The argument addrlen is a value-result parameter. Initially,
>      it  contains  the  amount  of  space  pointed to by addr; on
>      return it contains  the  length  in  bytes  of  the  address
>      returned. "
>
> Unfortunately, D returns an error at the copyin:
>
> dtrace: error on enabled probe ID 2 (ID 28357: fbt:sockfs:accept:return):
out of scratch space in action #1 at DIF offset 52
>
>
> If I print the value of arg2, it shows incredible 4290770780 .

That''s because (just like the accept() call itself), it''s
actually a
pointer to the value, not the value itself.  You have to do a
copyin(arg2, 4) first.

--
James Carlson         42.703N 71.076W         <carlsonj at
workingcode.com>