$dtrace -s sample.d -c ./a.out
dtrace: failed to compile script sample.d: line 12: copyinstr( ) argument #1 is 
incompatible with prototype:
        prototype: uintptr_t
         argument: char *

$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", copyinstr(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.
> 


      
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to