kgdb
[Top] [All Lists]

Re: remote debugging

To: kgdb@xxxxxxxxxxx
Subject: Re: remote debugging
From: sfoehner@xxxxxxxxxxxxxxxxxxx (Scott Foehner)
Date: Tue, 27 Feb 2001 14:46:00 -0800 (PST)
In-reply-to: Manoj Ekbote <manoj@xxxxxxxxxxxxxxxx> "remote debugging" (Feb 27, 2:06pm)
References: <3A9BFAD1.DBC6FC13@xxxxxxxxxxxxxxxx>
Sender: owner-kgdb@xxxxxxxxxxx
> I have applied a kgdb patch to kernel v.2.2.16.I could then build the
> kernel succesfully.
>
> I copied the bzImage to target m/c.
> On my host m/c, I run " gdb vmlinux" in /usr/src/linux directory.I have
> a .gdbinit file in my home directory which contains the folllowing
> lines:
>
> define rmt
> set remotebaud 9600
> target remote /dev/ttyS0
> end
>
> I start the target m/c and when it asks for a gdb connection from the
> host,I type "rmt" on the host m/c.
> I get a message telling breakpoint () at gdb.c:702.
> Next,I type "cont" at the gdb prompt.The booting process on the target
> m/c resumes and finishes.On the host m/c,I don't get the gdb prompt
> again.Why?

The kernel will continue to run normally unless it is told to drop into the
debugger.  This should happen automatically if there is a fault, or the user
can cause it to happen by setting a breakpoint, or simply by sending the
"break" keystroke (usually ctrl-c) from the host machine.

> Another question: What is the relationship between bzImage and
> vmlinux?It could sound out of topic,but I would like to know the answer.

Yeah, that has nothing to do with kgdb, but I can explain the basics.  vmlinux
is the actual OS kernel.  bzImage is a compressed version of vmlinux.  lilo
uses bzImage.  I believe this is because vmlinux is too large to fit into the
boot sector.

> When I do "file vmlinux", it tells me that it is an executable and
> bzImage is a boot sector image.So does it mean to say that bzImage is
> loaded first and then the control is passed on to vmlinux?

No, bzImage is all you need on the target machine, if you are using lilo.  If
you are booting without lilo, you generally boot from /vmlinux.  On the host
machine, you need to tell kgdb to look at vmlinux for symbols and stuff.

Scott

--
Scott Foehner  SGI  Linux Scalability  sfoehner@xxxxxxx  650.933.3473


<Prev in Thread] Current Thread [Next in Thread>
  • Re: remote debugging, Scott Foehner <=