From 87bb4394b84c3c8acf8aa2ccacc1ee8e58ab3910 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 19 Jul 2004 18:03:02 +0000 Subject: Allow the user who calls doadump() from the kernel debugger to not get a page fault if he has not defined a dump device. Panic can often not do a dump as it can hang forever in some cases. The original PR was for amd64 only. This is a generalised version of that change. PR: amd64/67712 Submitted by: wjw@withagen.nl --- sys/kern/kern_shutdown.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys') 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... */ -- cgit v1.1