Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/kdump map linux ptrace op (number) to it's appropria...
details: https://anonhg.NetBSD.org/src/rev/2619dfac7a4e
branches: trunk
changeset: 499169:2619dfac7a4e
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Nov 13 21:43:12 2000 +0000
description:
map linux ptrace op (number) to it's appropriate name - this is kind of hack,
but turned out to be pretty usable for me
diffstat:
usr.bin/kdump/kdump.c | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diffs (58 lines):
diff -r b25a16748b15 -r 2619dfac7a4e usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Mon Nov 13 21:38:48 2000 +0000
+++ b/usr.bin/kdump/kdump.c Mon Nov 13 21:43:12 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.30 2000/10/12 19:02:17 is Exp $ */
+/* $NetBSD: kdump.c,v 1.31 2000/11/13 21:43:12 jdolecek Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.30 2000/10/12 19:02:17 is Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.31 2000/11/13 21:43:12 jdolecek Exp $");
#endif
#endif /* not lint */
@@ -82,6 +82,17 @@
"PT_KILL", "PT_ATTACH", "PT_DETACH",
};
+static const char *linux_ptrace_ops[] = {
+ "PTRACE_TRACEME",
+ "PTRACE_PEEKTEXT", "PTRACE_PEEKDATA", "PTRACE_PEEKUSER",
+ "PTRACE_POKETEXT", "PTRACE_POKEDATA", "PTRACE_POKEUSER",
+ "PTRACE_CONT", "PTRACE_KILL", "PTRACE_SINGLESTEP",
+ NULL, NULL,
+ "PTRACE_GETREGS", "PTRACE_SETREGS", "PTRACE_GETFPREGS",
+ "PTRACE_SETFPREGS", "PTRACE_ATTACH", "PTRACE_DETACH",
+ "PTRACE_SYSCALL",
+};
+
int main __P((int, char **));
int fread_tail __P((char *, int, int));
void dumpheader __P((struct ktr_header *));
@@ -315,11 +326,19 @@
ap++;
argsize -= sizeof(register_t);
} else if (ktr->ktr_code == SYS_ptrace) {
- if (*ap >= 0 && *ap <=
+ if (strcmp(current->name, "linux") == 0) {
+ if (*ap >= 0 && *ap <=
+ sizeof(linux_ptrace_ops) / sizeof(linux_ptrace_ops[0]))
+ (void)printf("(%s", linux_ptrace_ops[*ap]);
+ else
+ (void)printf("(%ld", (long)*ap);
+ } else {
+ if (*ap >= 0 && *ap <=
sizeof(ptrace_ops) / sizeof(ptrace_ops[0]))
(void)printf("(%s", ptrace_ops[*ap]);
- else
+ else
(void)printf("(%ld", (long)*ap);
+ }
c = ',';
ap++;
argsize -= sizeof(register_t);
Home |
Main Index |
Thread Index |
Old Index