Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Same change in the kgdb code as was done in ddb:
details: https://anonhg.NetBSD.org/src/rev/ceb12e006e08
branches: trunk
changeset: 494976:ceb12e006e08
user: jeffs <jeffs%NetBSD.org@localhost>
date: Tue Jul 18 21:49:08 2000 +0000
description:
Same change in the kgdb code as was done in ddb:
Move platform db_trap callback from arch/mips into ddb as suggested by
jhawk. This callback is used by platform code to manage things like
watchdogs that should be disabled while in ddb. Done as a callback
for processors such as mips that support lots of different systems.
diffstat:
sys/kern/kgdb_stub.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diffs (48 lines):
diff -r 95c886b629ca -r ceb12e006e08 sys/kern/kgdb_stub.c
--- a/sys/kern/kgdb_stub.c Tue Jul 18 20:51:07 2000 +0000
+++ b/sys/kern/kgdb_stub.c Tue Jul 18 21:49:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kgdb_stub.c,v 1.6 1998/08/30 20:30:57 scottr Exp $ */
+/* $NetBSD: kgdb_stub.c,v 1.7 2000/07/18 21:49:08 jeffs Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -90,6 +90,13 @@
#define PUTC(c) ((*kgdb_putc)(kgdb_ioarg, c))
/*
+ * db_trap_callback can be hooked by MD port code to handle special
+ * cases such as disabling hardware watchdogs while in kgdb. Name
+ * is shared with DDB.
+ */
+void (*db_trap_callback)(int);
+
+/*
* This little routine exists simply so that bcopy() can be debugged.
*/
static void
@@ -332,6 +339,8 @@
return (0);
}
+ if (db_trap_callback) db_trap_callback(1);
+
/* Detect and recover from unexpected traps. */
if (kgdb_recover != 0) {
printf("kgdb: caught trap 0x%x at %p\n",
@@ -363,6 +372,7 @@
if (kgdb_active == 0) {
if (!IS_BREAKPOINT_TRAP(type, 0)) {
/* No debugger active -- let trap handle this. */
+ if (db_trap_callback) db_trap_callback(0);
return (0);
}
/* Make the PC point at the breakpoint... */
@@ -514,6 +524,7 @@
}
}
out:
+ if (db_trap_callback) db_trap_callback(0);
kgdb_recover = 0;
return (1);
}
Home |
Main Index |
Thread Index |
Old Index