Date: Wed, 8 Jan 2003 10:56:34 -0800 (PST) From: Brian Feldman <green@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 23436 for review Message-ID: <200301081856.h08IuY9G003797@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=23436 Change 23436 by green@green_laptop_2 on 2003/01/08 10:56:25 Print out more info in truss(1) for sysctl(2) calls. Affected files ... .. //depot/projects/trustedbsd/mac/usr.bin/truss/syscall.h#4 edit .. //depot/projects/trustedbsd/mac/usr.bin/truss/syscalls.c#8 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.bin/truss/syscall.h#4 (text+ko) ==== @@ -22,7 +22,7 @@ */ enum Argtype { None = 1, Hex, Octal, Int, String, Ptr, Stat, Ioctl, Quad, - Signal, Sockaddr, StringArray }; + Signal, Sockaddr, StringArray, HexArray }; #define ARG_MASK 0xff #define OUT 0x100 ==== //depot/projects/trustedbsd/mac/usr.bin/truss/syscalls.c#8 (text+ko) ==== @@ -108,6 +108,9 @@ { { String | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, { "linux_execve", 1, 3, { { String | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } }, + { "__sysctl", 1, 6, + { { HexArray | IN, 0 }, { Int, 1 }, { Ptr | IN, 2 }, { Ptr | IN, 3 }, + { Ptr | OUT, 4 }, { Int, 5 } } }, { 0, 0, 0, { { 0, 0 }}}, }; @@ -241,6 +244,33 @@ tmp = malloc(12); sprintf(tmp, "%ld", args[sc->offset]); break; + case HexArray: + { + char *old; + int num, i, *ary; + + num = (int)args[sc[1].offset]; + if (num <= 0) { + asprintf(&tmp, "[]"); + break; + } + ary = malloc(sizeof(int) * num); + if (get_struct(fd, (void *)args[sc->offset], (void *)ary, + sizeof(int) * num) == -1) { + err(1, "get_struct %p", (void *)args[sc->offset]); + } + asprintf(&tmp, "[%#lx", ((int *)args[sc->offset])[0]); + for (i = 1; i < num; i++) { + old = tmp; + asprintf(&tmp, "%s, %#lx", old, ary[i]); + free(old); + } + old = tmp; + asprintf(&tmp, "%s]", old); + free(old); + free(ary); + } + break; case String: { char *tmp2; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301081856.h08IuY9G003797>
