=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/kdump.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/kdump/kdump.c 2004/07/09 23:51:40 1.26 --- src/usr.bin/kdump/kdump.c 2005/06/02 17:32:02 1.27 *************** *** 1,4 **** ! /* $OpenBSD: kdump.c,v 1.26 2004/07/09 23:51:40 deraadt Exp $ */ /*- * Copyright (c) 1988, 1993 --- 1,4 ---- ! /* $OpenBSD: kdump.c,v 1.27 2005/06/02 17:32:02 mickey Exp $ */ /*- * Copyright (c) 1988, 1993 *************** *** 39,45 **** #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #endif ! static char *rcsid = "$OpenBSD: kdump.c,v 1.26 2004/07/09 23:51:40 deraadt Exp $"; #endif /* not lint */ #include --- 39,45 ---- #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #endif ! static char *rcsid = "$OpenBSD: kdump.c,v 1.27 2005/06/02 17:32:02 mickey Exp $"; #endif /* not lint */ #include *************** *** 359,374 **** else (void)printf("%s", current->sysnames[ktr->ktr_code]); ap = (register_t *)((char *)ktr + sizeof(struct ktr_syscall)); if (argsize) { ! char c = '('; if (fancy) { if (ktr->ktr_code == SYS_ioctl) { const char *cp; if (decimal) ! (void)printf("(%ld", (long)*ap); else ! (void)printf("(%#lx", (long)*ap); ap++; argsize -= sizeof(register_t); if ((cp = ioctlname(*ap)) != NULL) --- 359,375 ---- else (void)printf("%s", current->sysnames[ktr->ktr_code]); ap = (register_t *)((char *)ktr + sizeof(struct ktr_syscall)); + (void)putchar('('); if (argsize) { ! char c = '\0'; if (fancy) { if (ktr->ktr_code == SYS_ioctl) { const char *cp; if (decimal) ! (void)printf("%ld", (long)*ap); else ! (void)printf("%#lx", (long)*ap); ap++; argsize -= sizeof(register_t); if ((cp = ioctlname(*ap)) != NULL) *************** *** 378,416 **** c = ','; ap++; argsize -= sizeof(register_t); } else if (ktr->ktr_code == SYS_ptrace) { if (*ap >= 0 && *ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0])) ! (void)printf("(%s", ptrace_ops[*ap]); else switch(*ap) { #ifdef PT_GETFPREGS case PT_GETFPREGS: ! (void)printf("(PT_GETFPREGS"); break; #endif case PT_GETREGS: ! (void)printf("(PT_GETREGS"); break; #ifdef PT_SETFPREGS case PT_SETFPREGS: ! (void)printf("(PT_SETFPREGS"); break; #endif case PT_SETREGS: ! (void)printf("(PT_SETREGS"); break; #ifdef PT_STEP case PT_STEP: ! (void)printf("(PT_STEP"); break; #endif #ifdef PT_WCOOKIE case PT_WCOOKIE: ! (void)printf("(PT_WCOOKIE"); break; #endif default: ! (void)printf("(%ld", (long)*ap); break; } c = ','; --- 379,432 ---- c = ','; ap++; argsize -= sizeof(register_t); + } else if (ktr->ktr_code == SYS___sysctl) { + int *np, n; + + n = ap[1]; + np = (int *)(ap + 6); + for (; n--; np++) { + if (c) + putchar(c); + printf("%d", *np); + c = '.'; + } + + c = ','; + ap += 2; + argsize -= 2 * sizeof(register_t); } else if (ktr->ktr_code == SYS_ptrace) { if (*ap >= 0 && *ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0])) ! (void)printf("%s", ptrace_ops[*ap]); else switch(*ap) { #ifdef PT_GETFPREGS case PT_GETFPREGS: ! (void)printf("PT_GETFPREGS"); break; #endif case PT_GETREGS: ! (void)printf("PT_GETREGS"); break; #ifdef PT_SETFPREGS case PT_SETFPREGS: ! (void)printf("PT_SETFPREGS"); break; #endif case PT_SETREGS: ! (void)printf("PT_SETREGS"); break; #ifdef PT_STEP case PT_STEP: ! (void)printf("PT_STEP"); break; #endif #ifdef PT_WCOOKIE case PT_WCOOKIE: ! (void)printf("PT_WCOOKIE"); break; #endif default: ! (void)printf("%ld", (long)*ap); break; } c = ','; *************** *** 419,435 **** } } while (argsize) { if (decimal) ! (void)printf("%c%ld", c, (long)*ap); else ! (void)printf("%c%#lx", c, (long)*ap); c = ','; ap++; argsize -= sizeof(register_t); } - (void)putchar(')'); } ! (void)putchar('\n'); } static void --- 435,452 ---- } } while (argsize) { + if (c) + putchar(c); if (decimal) ! (void)printf("%ld", (long)*ap); else ! (void)printf("%#lx", (long)*ap); c = ','; ap++; argsize -= sizeof(register_t); } } ! (void)printf(")\n"); } static void