diff options
author | julian <julian@FreeBSD.org> | 2004-07-19 18:03:02 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-07-19 18:03:02 +0000 |
commit | 87bb4394b84c3c8acf8aa2ccacc1ee8e58ab3910 (patch) | |
tree | cd573665524b600e684031c63099840f019fbbff /sys/kern | |
parent | 7127c711e8b601427842ab900555fc3ededc389d (diff) | |
download | FreeBSD-src-87bb4394b84c3c8acf8aa2ccacc1ee8e58ab3910.zip FreeBSD-src-87bb4394b84c3c8acf8aa2ccacc1ee8e58ab3910.tar.gz |
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 <Willen Jan Withagen>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_shutdown.c | 13 |
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... */ |