aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
diff options
context:
space:
mode:
authorChris Costello <chris@FreeBSD.org>1999-11-07 01:54:56 +0000
committerChris Costello <chris@FreeBSD.org>1999-11-07 01:54:56 +0000
commit7cfb0ff20baf4f2ed457c591e5c792962760742e (patch)
treefdb193516e83bd6b95d9871f0130ea61c02974e6 /en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
parentb822a1769dfc75af2258e6ff0f3fe70a501b2d62 (diff)
downloaddoc-7cfb0ff20baf4f2ed457c591e5c792962760742e.tar.gz
doc-7cfb0ff20baf4f2ed457c591e5c792962760742e.zip
Rid blank lines of whitespace.
(Translation teams: You can ignore this commit.)
Notes
Notes: svn path=/head/; revision=6023
Diffstat (limited to 'en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml')
-rw-r--r--en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml40
1 files changed, 20 insertions, 20 deletions
diff --git a/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml b/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
index 1ebf9d9620..ce7b253523 100644
--- a/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
+++ b/en_US.ISO8859-1/books/developers-handbook/kerneldebug/chapter.sgml
@@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
- $FreeBSD$
+ $FreeBSD: doc/en_US.ISO_8859-1/books/handbook/kerneldebug/chapter.sgml,v 1.18 1999/09/06 06:52:59 peter Exp $
-->
<chapter id="kerneldebug">
@@ -55,7 +55,7 @@
some 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 memory will be wasted.</para>
-
+
<para>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 one in
order to get your system up and running again, boot it only into single
@@ -186,7 +186,7 @@
<varlistentry>
<term>line 20:</term>
-
+
<listitem>
<para>This is the location of function <function>trap()</function>
in the stack trace.</para>
@@ -195,7 +195,7 @@
<varlistentry>
<term>line 36:</term>
-
+
<listitem>
<para>Force usage of a new stack frame; this is no longer necessary
now. The stack frames are supposed to point to the right
@@ -210,7 +210,7 @@
<varlistentry>
<term>line 52:</term>
-
+
<listitem>
<para>The pointer looks suspicious, but happens to be a valid
address.</para>
@@ -219,7 +219,7 @@
<varlistentry>
<term>line 56:</term>
-
+
<listitem>
<para>However, it obviously points to garbage, so we have found our
error! (For those unfamiliar with that particular piece of code:
@@ -251,7 +251,7 @@
<para>What do you do if a kernel dumped core but you did not expect it,
and it is therefore not compiled using <command>config -g</command>? Not
everything is lost here. Do not panic!</para>
-
+
<para>Of course, you still need to enable crash dumps. See above on the
options you have to specify in order to do this.</para>
@@ -271,14 +271,14 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols</
faulting one but some debugging symbols. You should at least verify the
old and new sizes with the &man.size.1; command. If there is a
mismatch, you probably need to give up here.</para>
-
+
<para>Go and examine the dump as described above. The debugging symbols
might be incomplete for some places, as can be seen in the stack trace
in the example above where some functions are displayed without line
numbers and argument lists. If you need more debugging symbols, remove
the appropriate object files and repeat the <command>kgdb</command>
session until you know enough.</para>
-
+
<para>All this is not guaranteed to work, but it will do it fine in most
cases.</para>
</sect1>
@@ -290,14 +290,14 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols</
high level of user interface, there are some things it cannot do. The
most important ones being breakpointing and single-stepping kernel
code.</para>
-
+
<para>If you need to do low-level debugging on your kernel, there is an
on-line debugger available called DDB. It allows to setting
breakpoints, single-stepping kernel functions, examining and changing
kernel variables, etc. However, it cannot access kernel source files,
and only has access to the global and static symbols, not to the full
debug information like <command>kgdb</command>.</para>
-
+
<para>To configure your kernel to include DDB, add the option line
<programlisting>
@@ -318,7 +318,7 @@ options DDB</programlisting>
<option>-d</option> right at the boot prompt. The kernel will start up
in debug mode and enter DDB prior to any device probing. Hence you can
even debug the device probe/attach functions.</para>
-
+
<para>The second scenario is a hot-key on the keyboard, usually
Ctrl-Alt-ESC. For syscons, this can be remapped; some of the
distributed maps do this, so watch out. There is an option available
@@ -327,11 +327,11 @@ options DDB</programlisting>
in the kernel config file). It is not the default since there are a lot
of crappy serial adapters around that gratuitously generate a BREAK
condition, for example when pulling the cable.</para>
-
+
<para>The third way is that any panic condition will branch to DDB if the
kernel is configured to use it. For this reason, it is not wise to
configure a kernel with DDB for a machine running unattended.</para>
-
+
<para>The DDB commands roughly resemble some <command>gdb</command>
commands. The first thing you probably need to do is to set a
breakpoint:</para>
@@ -344,7 +344,7 @@ options DDB</programlisting>
<literal>a-f</literal> need to be preceded with <literal>0x</literal>
(this is optional for other numbers). Simple expressions are allowed,
for example: <literal>function-name + 0x103</literal>.</para>
-
+
<para>To continue the operation of an interrupted kernel, simply
type:</para>
@@ -419,11 +419,11 @@ options DDB</programlisting>
specifies the size of the data to be written, the first following
expression is the address to write to and the remainder is interpreted
as data to write to successive memory locations.</para>
-
+
<para>If you need to know the current registers, use:</para>
<screen><userinput>show reg</userinput></screen>
-
+
<para>Alternatively, you can display a single register value by e.g.
<screen><userinput>p $eax</userinput></screen>
@@ -468,7 +468,7 @@ options DDB</programlisting>
<para>is the final way out of disaster and almost the same as hitting the
Big Red Button.</para>
-
+
<para>If you need a short command summary, simply type:</para>
<screen><userinput>help</userinput></screen>
@@ -493,7 +493,7 @@ options DDB</programlisting>
with all the symbols in it, and the other one is the target machine that
simply runs a similar copy of the very same kernel (but stripped of the
debugging information).</para>
-
+
<para>You should configure the kernel in question with <command>config
-g</command>, include <option>DDB</option> into the configuration, and
compile it as usual. This gives a large blurb of a binary, due to the
@@ -573,7 +573,7 @@ text_addr = 0xf5109020? (y or n) <userinput>y</userinput>
<sect1>
<title>Debugging a Console Driver</title>
-
+
<para>Since you need a console driver to run DDB on, things are more
complicated if the console driver itself is failing. You might remember
the use of a serial console (either with modified boot blocks, or by