|
Lines 685-700
Link Here
|
| 685 |
simply runs a similar copy of the very same kernel (but stripped of the |
685 |
simply runs a similar copy of the very same kernel (but stripped of the |
| 686 |
debugging information).</para> |
686 |
debugging information).</para> |
| 687 |
|
687 |
|
| 688 |
<para>You should configure the kernel in question with <command>config |
688 |
<para>You should configure the kernel in question with <command>config -g |
| 689 |
-g</command>, include <option>DDB</option> into the configuration, and |
689 |
</command> if building the "Traditional" way. If building the "New" way, |
| 690 |
compile it as usual. This gives a large binary, due to the |
690 |
make sure the line |
| 691 |
debugging information. Copy this kernel to the target machine, strip |
691 |
|
| 692 |
the debugging symbols off with <command>strip -x</command>, and boot it |
692 |
<programlisting>makeoptions DEBUG=-g</programlisting> |
| 693 |
using the <option>-d</option> boot option. Connect the serial line |
693 |
|
| 694 |
of the target machine that has "flags 080" set on its sio device |
694 |
is in the configuration. In both cases include <option>DDB</option> and |
| 695 |
to any serial line of the debugging host. |
695 |
<option>GDB</option> into the configuration, and compile it as usual. This |
| 696 |
Now, on the debugging machine, go to the compile directory of the target |
696 |
gives a large binary, due to the debugging information. Copy this kernel |
| 697 |
kernel, and start <command>gdb</command>:</para> |
697 |
to the target machine, strip the debugging symbols off with <command>strip |
|
|
698 |
-x</command>, and boot it using the <option>-d</option> boot option. |
| 699 |
Connect the serial line of the target machine that has "flags 080" set on |
| 700 |
its sio device to any serial line of the debugging host. See the |
| 701 |
&man.sio.4; man page to see how to set the flags on an sio device. Now, on |
| 702 |
the debugging machine, go to the compile directory of the target kernel, |
| 703 |
and start <command>gdb</command>:</para> |
| 698 |
|
704 |
|
| 699 |
<screen>&prompt.user; <userinput>kgdb kernel</userinput> |
705 |
<screen>&prompt.user; <userinput>kgdb kernel</userinput> |
| 700 |
GDB is free software and you are welcome to distribute copies of it |
706 |
GDB is free software and you are welcome to distribute copies of it |