diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-04 20:39:28 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-04 20:39:28 +0000 |
commit | e7d9191546e5df1017cb3056b906903409eec220 (patch) | |
tree | 5c3822a9deb2c800cceb9f321183a49e24cd344f /usr.bin | |
parent | bb4b43cd219867354329c77ccc0366f119e0c748 (diff) |
Better ptrace description, also fix an off-by-one spotted by otto
ok otto@ tdeval@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/kdump/kdump.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index a519a644a84..349cfc111ec 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.23 2003/10/13 00:44:25 tedu Exp $ */ +/* $OpenBSD: kdump.c,v 1.24 2004/03/04 20:39:27 miod Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #endif -static char *rcsid = "$OpenBSD: kdump.c,v 1.23 2003/10/13 00:44:25 tedu Exp $"; +static char *rcsid = "$OpenBSD: kdump.c,v 1.24 2004/03/04 20:39:27 miod Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -373,11 +373,40 @@ ktrsyscall(struct ktr_syscall *ktr) ap++; argsize -= sizeof(register_t); } else if (ktr->ktr_code == SYS_ptrace) { - if (*ap >= 0 && *ap <= + if (*ap >= 0 && *ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0])) (void)printf("(%s", ptrace_ops[*ap]); - else + 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 = ','; ap++; argsize -= sizeof(register_t); |