Minor corrections.
Submitted by: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
This commit is contained in:
parent
898ec03dec
commit
dda8aeade9
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=46
1 changed files with 29 additions and 27 deletions
|
@ -1,13 +1,6 @@
|
||||||
<!-- $Id: kerneldebug.sgml,v 1.2 1995-06-30 17:37:41 jfieber Exp $ -->
|
<!-- $Id: kerneldebug.sgml,v 1.3 1995-07-31 01:18:46 jfieber Exp $ -->
|
||||||
<!-- The FreeBSD Documentation Project -->
|
<!-- The FreeBSD Documentation Project -->
|
||||||
|
|
||||||
<!--
|
|
||||||
<!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN" [
|
|
||||||
<!ENTITY % authors SYSTEM "authors.sgml">
|
|
||||||
%authors;
|
|
||||||
]>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<chapt><heading>Kernel Debugging<label id="kerneldebug"></heading>
|
<chapt><heading>Kernel Debugging<label id="kerneldebug"></heading>
|
||||||
|
|
||||||
<p><em>Contributed by &a.paul; and &a.joerg;</em>
|
<p><em>Contributed by &a.paul; and &a.joerg;</em>
|
||||||
|
@ -16,23 +9,28 @@
|
||||||
|
|
||||||
<p>Here are some instructions for getting kernel debugging
|
<p>Here are some instructions for getting kernel debugging
|
||||||
working on a crash dump, it assumes that you have enough swap
|
working on a crash dump, it assumes that you have enough swap
|
||||||
space for a crash dump. If you happen to have multiple swap
|
space for a crash dump. If you have multiple swap
|
||||||
partitions with the first one being too small to keep the dump,
|
partitions and the first one is too small to hold the dump,
|
||||||
you can configure your kernel to use an alternate dump device
|
you can configure your kernel to use an alternate dump device
|
||||||
(in the <tt>kernel</tt> line). Dumps to non-swap devices,
|
(in the <tt>config kernel</tt> line), or
|
||||||
|
you can specify an alternate using the dumpon(8) command.
|
||||||
|
Dumps to non-swap devices,
|
||||||
tapes for example, are currently not supported. Config your
|
tapes for example, are currently not supported. Config your
|
||||||
kernel using <tt>config -g</tt>.
|
kernel using <tt>config -g</tt>.
|
||||||
<!-- XXX obsolete?
|
|
||||||
Remember that you need to
|
|
||||||
specify
|
|
||||||
<tscreen><verb>
|
|
||||||
options DODUMP
|
|
||||||
</verb></tscreen>
|
|
||||||
in your config file in order to get kernel core dumps.
|
|
||||||
-->
|
|
||||||
See <ref id="kernelconfig" name="Kernel Configuration"> for
|
See <ref id="kernelconfig" name="Kernel Configuration"> for
|
||||||
details on configuring the FreeBSD kernel.
|
details on configuring the FreeBSD kernel.
|
||||||
|
|
||||||
|
Use the <tt>dumpon(8)</tt> command to tell the kernel where to dump
|
||||||
|
to (note that this will have to be done after configuring the
|
||||||
|
partition in question as swap space via <tt>swapon(8)</tt>). This is
|
||||||
|
normally arranged via <tt>/etc/sysconfig</tt> and <tt>/etc/rc</tt>.
|
||||||
|
Alternatively, you can
|
||||||
|
hard-code the dump device via the `dump' clause in the `config' line
|
||||||
|
of your kernel config file. This is deprecated, but might be the
|
||||||
|
only chance to get a crash dump from a kernel that's not booting at
|
||||||
|
all, so that you didn't had the ability to run any command before it
|
||||||
|
used to crash.
|
||||||
|
|
||||||
<em><bf>Note:</bf> In the following, the term `<tt>kgdb</tt>' refers
|
<em><bf>Note:</bf> In the following, the term `<tt>kgdb</tt>' refers
|
||||||
to <tt>gdb</tt> run in `kernel debug mode'. This can be accomplished by
|
to <tt>gdb</tt> run in `kernel debug mode'. This can be accomplished by
|
||||||
either starting the <tt>gdb</tt> with the option <tt>-k</tt>, or by linking
|
either starting the <tt>gdb</tt> with the option <tt>-k</tt>, or by linking
|
||||||
|
@ -43,7 +41,10 @@ options DODUMP
|
||||||
<tt>kernel.debug</tt>, and then run <tt>strip -x</tt> on the
|
<tt>kernel.debug</tt>, and then run <tt>strip -x</tt> on the
|
||||||
original. Install the original as normal. You may also install
|
original. Install the original as normal. You may also install
|
||||||
the unstripped kernel, but symbol table lookup time for some
|
the unstripped kernel, but symbol table lookup time for some
|
||||||
programs might drastically increase.
|
programs will drastically increase, and since
|
||||||
|
the whole kernel is loaded entirely at boot time and cannot be
|
||||||
|
swapped out later, several megabytes of
|
||||||
|
physical RAM willl be wasted.
|
||||||
|
|
||||||
If you are testing a new kernel, for example by typing the new
|
If you are testing a new kernel, for example by typing the new
|
||||||
kernel's name at the boot prompt, but need to boot a different
|
kernel's name at the boot prompt, but need to boot a different
|
||||||
|
@ -200,14 +201,12 @@ options DODUMP
|
||||||
it, and it's therefore not compiled using <tt>config -g</tt>?
|
it, and it's therefore not compiled using <tt>config -g</tt>?
|
||||||
Not everything is lost here. Don't panic!
|
Not everything is lost here. Don't panic!
|
||||||
|
|
||||||
<!-- XXX obsolete?
|
Of course, you still need to enable crash dumps. See above
|
||||||
Of course, you still need to configure all your kernels with the
|
on the options you've got to do this.
|
||||||
DODUMP option being set, otherwise you won't get a core dump at all.
|
|
||||||
(This is for safety reasons in the default kernels, to avoid them
|
(This is for safety reasons in the default kernels, to avoid them
|
||||||
trying to dump e.g. during system installation where there's no
|
trying to dump e.g. during system installation where there's no
|
||||||
FreeBSD partition at all and valuable data on the disk could be
|
FreeBSD partition at all and valuable data on the disk could be
|
||||||
destroyed.)
|
destroyed.)
|
||||||
-->
|
|
||||||
|
|
||||||
Go to your kernel compile directory, and edit the line
|
Go to your kernel compile directory, and edit the line
|
||||||
containing <tt>COPTFLAGS?=-O</tt>. Add the <tt>-g</tt> option
|
containing <tt>COPTFLAGS?=-O</tt>. Add the <tt>-g</tt> option
|
||||||
|
@ -269,8 +268,11 @@ options DODUMP
|
||||||
|
|
||||||
The second scenario is a hot-key on the keyboard, usually
|
The second scenario is a hot-key on the keyboard, usually
|
||||||
Ctrl-Alt-ESC. For syscons, this can be remapped, and some of
|
Ctrl-Alt-ESC. For syscons, this can be remapped, and some of
|
||||||
the distributed maps do this, so watch out. Patches for a
|
the distributed maps do this, so watch out.
|
||||||
COMCONSOLE kernel, are available from &a.joerg;.
|
There's an option
|
||||||
|
available for a COMCONSOLE kernel (``options BREAK_TO_DEBUGGER'')
|
||||||
|
that allows the use of a serial line BREAK on the console line to
|
||||||
|
enter DDB.
|
||||||
|
|
||||||
The third way is that any panic condition will branch to DDB if
|
The third way is that any panic condition will branch to DDB if
|
||||||
the kernel is configured to use it. It is not wise to
|
the kernel is configured to use it. It is not wise to
|
||||||
|
|
Loading…
Reference in a new issue