aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2007-12-25 17:52:02 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-12-25 17:52:02 +0000
commit3de213cc00f2889d2cd693968fd38c10a7f5def1 (patch)
treeae45f86ab6fb75519ba2d9dbc206616dba84cc13 /sys/sys
parent6862d27ecd3a641713fe08d9572a27bf218cc8d9 (diff)
downloadsrc-3de213cc00f2889d2cd693968fd38c10a7f5def1.tar.gz
src-3de213cc00f2889d2cd693968fd38c10a7f5def1.zip
Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface.
Notes
Notes: svn path=/head/; revision=174898
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/kdb.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h
index ece16fc5aff8..0f989f5cac40 100644
--- a/sys/sys/kdb.h
+++ b/sys/sys/kdb.h
@@ -66,7 +66,7 @@ extern struct thread *kdb_thread; /* Current thread. */
int kdb_alt_break(int, int *);
void kdb_backtrace(void);
int kdb_dbbe_select(const char *);
-void kdb_enter(const char *);
+void kdb_enter(const char *, const char *);
void kdb_init(void);
void * kdb_jmpbuf(jmp_buf);
void kdb_reenter(void);
@@ -78,4 +78,31 @@ struct thread *kdb_thr_next(struct thread *);
int kdb_thr_select(struct thread *);
int kdb_trap(int, int, struct trapframe *);
+/*
+ * KDB enters the debugger via breakpoint(), which leaves the debugger without
+ * a lot of information about why it was entered. This simple enumerated set
+ * captures some basic information.
+ *
+ * It is recommended that values here be short (<16 character) alpha-numeric
+ * strings, as they will be used to construct DDB(4) script names.
+ */
+extern const char * volatile kdb_why;
+#define KDB_WHY_UNSET NULL /* No reason set. */
+#define KDB_WHY_PANIC "panic" /* panic() was called. */
+#define KDB_WHY_SYSCTL "sysctl" /* Sysctl entered debugger. */
+#define KDB_WHY_BOOTFLAGS "bootflags" /* Boot flags were set. */
+#define KDB_WHY_WITNESS "witness" /* Witness entered debugger. */
+#define KDB_WHY_VFSLOCK "vfslock" /* VFS detected lock problem. */
+#define KDB_WHY_NETGRAPH "netgraph" /* Netgraph entered debugger. */
+#define KDB_WHY_BREAK "break" /* Console or serial break. */
+#define KDB_WHY_WATCHDOG "watchdog" /* Watchdog entered debugger. */
+#define KDB_WHY_CAM "cam" /* CAM has entered debugger. */
+#define KDB_WHY_NDIS "ndis" /* NDIS entered debugger. */
+#define KDB_WHY_ACPI "acpi" /* ACPI entered debugger. */
+#define KDB_WHY_TRAPSIG "trapsig" /* Sun4v/Sparc fault. */
+#define KDB_WHY_POWERFAIL "powerfail" /* Powerfail NMI. */
+#define KDB_WHY_MAC "mac" /* MAC Framework. */
+#define KDB_WHY_POWERPC "powerpc" /* Unhandled powerpc intr. */
+#define KDB_WHY_UNIONFS "unionfs" /* Unionfs bug. */
+
#endif /* !_SYS_KDB_H_ */