aboutsummaryrefslogtreecommitdiff
path: root/zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml
diff options
context:
space:
mode:
Diffstat (limited to 'zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml')
-rw-r--r--zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml61
1 files changed, 26 insertions, 35 deletions
diff --git a/zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml b/zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml
index 2062206e1c..6afe2c893f 100644
--- a/zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml
+++ b/zh_TW.Big5/books/developers-handbook/kerneldebug/chapter.xml
@@ -4,25 +4,17 @@
$FreeBSD$
-->
-
-<chapter id="kerneldebug">
- <chapterinfo>
+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="kerneldebug">
+ <info><title>Kernel Debugging</title>
<authorgroup>
- <author>
- <firstname>Paul</firstname>
- <surname>Richards</surname>
- <contrib>Contributed by </contrib>
- </author>
- <author>
- <firstname>J&ouml;rg</firstname>
- <surname>Wunsch</surname>
- </author>
+ <author><personname><firstname>Paul</firstname><surname>Richards</surname></personname><contrib>Contributed by </contrib></author>
+ <author><personname><firstname>J&ouml;rg</firstname><surname>Wunsch</surname></personname></author>
</authorgroup>
- </chapterinfo>
+ </info>
- <title>Kernel Debugging</title>
+
- <sect1 id="kerneldebug-obtain">
+ <sect1 xml:id="kerneldebug-obtain">
<title>Obtaining a Kernel Crash Dump</title>
<para>When running a development kernel (eg: &os.current;), such as a
@@ -58,7 +50,7 @@
valid dump device, the kernel dumps the contents of what is in
physical memory to the swap device.</para>
- <sect2 id="config-dumpdev">
+ <sect2 xml:id="config-dumpdev">
<title>Configuring the Dump Device</title>
<para>Before the kernel will dump the contents of its physical
@@ -92,7 +84,7 @@
</important>
</sect2>
- <sect2 id="extract-dump">
+ <sect2 xml:id="extract-dump">
<title>Extracting a Kernel Dump</title>
<para>Once a dump has been written to a dump device, the dump
@@ -144,7 +136,7 @@
</sect2>
</sect1>
- <sect1 id="kerneldebug-gdb">
+ <sect1 xml:id="kerneldebug-gdb">
<title>Debugging a Kernel Crash Dump with <command>kgdb</command></title>
<note>
@@ -159,8 +151,8 @@
the crash dump, locate the debug version of your kernel
(normally called <filename>kernel.debug</filename>) and the path
to the source files used to build your kernel (normally
- <filename>/usr/obj/usr/src/sys/<replaceable>KERNCONF</replaceable></filename>,
- where <filename><replaceable>KERNCONF</replaceable></filename>
+ <filename>/usr/obj/usr/src/sys/KERNCONF</filename>,
+ where <filename>KERNCONF</filename>
is the <varname>ident</varname> specified in a kernel
&man.config.5;). With those two pieces of info, let the
debugging commence!</para>
@@ -168,7 +160,7 @@
<para>To enter into the debugger and begin getting information
from the dump, the following steps are required at a minimum:</para>
- <screen>&prompt.root; <userinput>cd /usr/obj/usr/src/sys/<replaceable>KERNCONF</replaceable></userinput>
+ <screen>&prompt.root; <userinput>cd /usr/obj/usr/src/sys/KERNCONF</userinput>
&prompt.root; <userinput>kgdb kernel.debug /var/crash/vmcore.0</userinput></screen>
<para>You can debug the crash dump using the kernel sources just like
@@ -186,7 +178,7 @@
your patch winds its way into the source tree via a problem
report, mailing lists, or by being able to commit it!</para>
- <screen> 1:&prompt.root; <userinput>cd /usr/obj/usr/src/sys/<replaceable>KERNCONF</replaceable></userinput>
+ <screen> 1:&prompt.root; <userinput>cd /usr/obj/usr/src/sys/KERNCONF</userinput>
2:&prompt.root; <userinput>kgdb kernel.debug /var/crash/vmcore.0</userinput>
3:GNU gdb 5.2.1 (FreeBSD)
4:Copyright 2002 Free Software Foundation, Inc.
@@ -427,12 +419,12 @@
considerable amount of disk space!</para></tip>
</sect1>
- <sect1 id="kerneldebug-ddd">
+ <sect1 xml:id="kerneldebug-ddd">
<title>Debugging a Crash Dump with DDD</title>
<para>Examining a kernel crash dump with a graphical debugger like
<command>ddd</command> is also possible (you will need to install
- the <filename role="package">devel/ddd</filename> port in order to use the
+ the <package>devel/ddd</package> port in order to use the
<command>ddd</command> debugger). Add the <option>-k</option>
option to the <command>ddd</command> command line you would use
normally. For example;</para>
@@ -443,7 +435,7 @@
<command>ddd</command>'s graphical interface.</para>
</sect1>
- <sect1 id="kerneldebug-post-mortem">
+ <sect1 xml:id="kerneldebug-post-mortem">
<title>Post-Mortem Analysis of a Dump</title>
<para>What do you do if a kernel dumped core but you did not expect it,
@@ -454,7 +446,7 @@
options you have to specify in order to do this.</para>
<para>Go to your kernel config directory
- (<filename>/usr/src/sys/<replaceable>arch</replaceable>/conf</filename>)
+ (<filename>/usr/src/sys/arch/conf</filename>)
and edit your configuration file. Uncomment (or add, if it does not
exist) the following line:</para>
@@ -474,17 +466,17 @@
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, recompile the kernel again and repeat the
- <command>gdb <option>-k</option></command>
+ <command>gdb -k</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>
- <sect1 id="kerneldebug-online-ddb">
+ <sect1 xml:id="kerneldebug-online-ddb">
<title>On-Line Kernel Debugging Using DDB</title>
- <para>While <command>gdb <option>-k</option></command> as an off-line debugger provides a very
+ <para>While <command>gdb -k</command> as an off-line debugger provides a very
high level of user interface, there are some things it cannot do. The
most important ones being breakpointing and single-stepping kernel
code.</para>
@@ -500,8 +492,7 @@
<programlisting>options DDB</programlisting>
- to your config file, and rebuild. (See <ulink
- url="&url.books.handbook;/index.html">The FreeBSD Handbook</ulink> for details on
+ to your config file, and rebuild. (See <link xlink:href="&url.books.handbook;/index.html">The FreeBSD Handbook</link> for details on
configuring the FreeBSD kernel).</para>
<note>
@@ -686,7 +677,7 @@
single-stepping the kernel.</para>
</sect1>
- <sect1 id="kerneldebug-online-gdb">
+ <sect1 xml:id="kerneldebug-online-gdb">
<title>On-Line Kernel Debugging Using Remote GDB</title>
<para>This feature has been supported since FreeBSD 2.2, and it is
@@ -752,7 +743,7 @@ Debugger (msg=0xf01b0383 "Boot flags requested debugger")
window), etc.</para>
</sect1>
- <sect1 id="kerneldebug-kld">
+ <sect1 xml:id="kerneldebug-kld">
<title>Debugging Loadable Modules Using GDB</title>
<para>When debugging a panic that occurred within a module, or
@@ -811,7 +802,7 @@ Reading symbols from /sys/modules/linux/linux.ko...done.
module.</para>
</sect1>
- <sect1 id="kerneldebug-console">
+ <sect1 xml:id="kerneldebug-console">
<title>Debugging a Console Driver</title>
<para>Since you need a console driver to run DDB on, things are more
@@ -823,7 +814,7 @@ Reading symbols from /sys/modules/linux/linux.ko...done.
console.</para>
</sect1>
- <sect1 id="kerneldebug-deadlocks">
+ <sect1 xml:id="kerneldebug-deadlocks">
<title>Debugging the Deadlocks</title>
<para>You may experience so called deadlocks, the situation where