On Jul 26, 2009, at 2:09 PM, Chad Mynhier wrote:
If the memory pointed to by arg1 is a null-terminated string, you
could just do this:

printf("%s\n", copyinstr(arg1));


Even without the terminating null, you can use copyinstr() with its optional second argument that specifies the length of the string being copied in. For
example, calls to write(2) obviously don't need to use null-terminated
strings so the following takes this into account:

syscall::write:entry
{
        trace(copyinstr(arg1, arg2));
}

Adam

--
Adam Leventhal, Fishworks                        http://blogs.sun.com/ahl

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

Reply via email to