On Nov 3, 2008, at 4:10 AM, [EMAIL PROTECTED] wrote:
> and a DTrace script :
> $cat sample.d
> struct xxx
> {
> int yyy;
> int zzz;
> const char *name;
> };
>
> pid$target:a.out:*sub1*:entry
> {
> sp = (struct xxx *) copyin (arg0, sizeof (struct xxx));
> printf ("DTrace: %d %d \n", sp->yyy, sp->zzz);
> printf ("DTrace: name=%s\n", stringof(sp->name));
> exit (0);
> }
You've correctly copied the structure into DTrace's address space, but
you
didn't copy in the const char * (string). Rather than doing stringof()
on
sp->name, use the copyinstr() subroutine.
Adam
--
Adam Leventhal, Fishworks http://blogs.sun.com/ahl
_______________________________________________
dtrace-discuss mailing list
[email protected]