Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/usr.bin/kdump Pull up revision 1.78 (requested by matt ...
details: https://anonhg.NetBSD.org/src/rev/35e577d61145
branches: netbsd-2-0
changeset: 560812:35e577d61145
user: tron <tron%NetBSD.org@localhost>
date: Mon May 10 14:44:18 2004 +0000
description:
Pull up revision 1.78 (requested by matt in ticket #278):
Allow kdump to print the names for machine dependent ptrace ops.
(This requires <machine/ptrace.h> to define PT_MACHDEP_STRINGS
which corresponds to the machdep ops).
diffstat:
usr.bin/kdump/kdump.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diffs (54 lines):
diff -r f92ff718b89b -r 35e577d61145 usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Mon May 10 14:40:47 2004 +0000
+++ b/usr.bin/kdump/kdump.c Mon May 10 14:44:18 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.77 2004/03/07 17:20:53 dsl Exp $ */
+/* $NetBSD: kdump.c,v 1.77.2.1 2004/05/10 14:44:18 tron Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.77 2004/03/07 17:20:53 dsl Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.77.2.1 2004/05/10 14:44:18 tron Exp $");
#endif
#endif /* not lint */
@@ -78,13 +78,18 @@
#define eqs(s1, s2) (strcmp((s1), (s2)) == 0)
#define small(v) (((long)(v) >= 0) && ((long)(v) < 10))
-static const char *ptrace_ops[] = {
+static const char * const ptrace_ops[] = {
"PT_TRACE_ME", "PT_READ_I", "PT_READ_D", "PT_READ_U",
"PT_WRITE_I", "PT_WRITE_D", "PT_WRITE_U", "PT_CONTINUE",
- "PT_KILL", "PT_ATTACH", "PT_DETACH",
+ "PT_KILL", "PT_ATTACH", "PT_DETACH", "PT_IO",
+ "PT_DUMPCORE", "PT_LWPINFO"
};
-static const char *linux_ptrace_ops[] = {
+#ifdef PT_MACHDEP_STRINGS
+static const char * const ptrace_machdep_ops[] = { PT_MACHDEP_STRINGS };
+#endif
+
+static const char * const linux_ptrace_ops[] = {
"PTRACE_TRACEME",
"PTRACE_PEEKTEXT", "PTRACE_PEEKDATA", "PTRACE_PEEKUSER",
"PTRACE_POKETEXT", "PTRACE_POKEDATA", "PTRACE_POKEUSER",
@@ -474,6 +479,13 @@
if (*ap >= 0 && *ap <
sizeof(ptrace_ops) / sizeof(ptrace_ops[0]))
(void)printf("%s", ptrace_ops[*ap]);
+#ifdef PT_MACHDEP_STRINGS
+ else if (*ap >= PT_FIRSTMACH &&
+ *ap - PT_FIRSTMACH <
+ sizeof(ptrace_machdep_ops) /
+ sizeof(ptrace_machdep_ops[0]))
+ (void)printf("%s", ptrace_machdep_ops[*ap - PT_FIRSTMACH]);
+#endif
else
output_long((long)*ap, 1);
}
Home |
Main Index |
Thread Index |
Old Index