summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index a228d1b..f55a341 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -231,6 +231,16 @@ static void
doadump(void)
{
+ /*
+ * Sometimes people have to call this from the kernel debugger.
+ * (if 'panic' can not dump)
+ * Give them a clue as to why they can't dump.
+ */
+ if (dumper.dumper == NULL) {
+ printf("cannot dump. No dump device defined.\n");
+ return;
+ }
+
savectx(&dumppcb);
dumptid = curthread->td_tid;
dumping++;
@@ -378,8 +388,7 @@ boot(int howto)
*/
EVENTHANDLER_INVOKE(shutdown_post_sync, howto);
splhigh();
- if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP &&
- !cold && dumper.dumper != NULL && !dumping)
+ if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold && !dumping)
doadump();
/* Now that we're going to really halt the system... */
OpenPOWER on IntegriCloud