Alex Holden wrote
> 
> On Tue, 5 Jan 1999, Alan Cox wrote:
> > you could possibly need. Also for kernel debugging work you can run gdb
> > over a serial port and single step a target from a remote gdb - very
> > useful inded
> 
> I've heard that before, but how do you actually do it?

The GDB info pages are fairly detailed in this respect.  I've
not done it on Linux, but have on other UNIX kernels.  What it
amounts to is:

- Cause the kernel to jump to the gdb remote stub at some point
  (either by recompiling it or with a boot-line parameter, depending
   on what your kernel supports)
- Start (a compatible) gdb running on a machine connected to the
  machine you want to debug (via a serial port).  Lets presume
  that the maching running gdb uses /dev/tty01 to talk to the
  machine you want to debug.
  (we used to have to use the "-k" parameter to gdb, as well, to
   debug the kernel)
- At the gdb prompt, you use the "target" command to select a
  protocol and destination to debug.  The simplest protocol,
  which works over the serial port, is "remote".  So, you would
  type "target remote /dev/tty01" to attach gdb to the other
  machine's kernel.

At that point you should be able to step through and debug things.
You will need access to a kernel with symbols and all necessary
sources on the machine running the debugger.  You may need the
"file" command to get your symbol-laden kernel loaded.

D

-- 
===============================================================================
[EMAIL PROTECTED] http://www-cs-students.stanford.edu/~dsmythe/home.html
(612) 979-1249       "Have you lived here all your life?"  "Not yet..."
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to