Re: Kernel with debugging info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



n Tue, 2002-05-14 at 18:53, Christine Ames wrote:
> --- Frank Schaefer <frank.schafer@setuza.cz> wrote:
> > On Mon, 2002-05-13 at 19:27, Christine Ames wrote:
> > > --- Frank Schaefer <frank.schafer@setuza.cz> wrote:
> > > > Hi there,
> > > > 
> > > > Does anybody know, how to build a kernel with debug info? There
> > > > isn't a
> > > > appropriate option in ``make *config''.
> > > > Will it be sufficient to add the -g switch to the CFLAGS in the
> > > > main
> > > > Makefile?
> > > > 
> > > 
> > > Hmmm...debug info...  Are you talking about using kdbg or some
> > other
> > > debugger?
> > 
> > Yes, I try to setup kgdb / kdb.
> > 
> 
> I've done this, and after applying the patch, you "make xconfig" as
> usual.  Be sure to turn on whatever "Kernel Hacking" stuff you want. 
> (The options which were made available by the patch.)  Afterwards,
> build your new kernel in the usual way:
> 
> make dep && make clean && make bzImage
> make modules && make modules_install
> 
> AFAIK, there is no reason to edit the makefile yourself.
> 
> 
> > > In that case, you need to patch the kernel to make debugging
> > options
> > > available.  After patching, you rebuild your kernel.  The patch
> > makes
> > > available new options under "Kernel Hacking" when using xconfig.
> > > 
> > > For the patch, FAQ, etc. see http://kgdb.sourceforge.net/
> > 
> > I know that, and I have the patches for kdb and kgdb. But if I
> > configure
> > the kernel I still don't see any -g during the kernel build. Maybe
> > I've
> > overseen them. I'll build onesmore this evening sending the output
> > of
> > make into a log.
> > 
> 
> What seems to be the problem?  Does your build fail?

My fault, the -g switches in the output of make escaped my attention.

Finally I found some time to complete the kgdb setup, but another
problem arises.
I've set up the hardware, and develhost and testhost communicate via
ttyS0.
The debugger (gdb-5.0) starts up with ``gdb vmlinux''. The plain 2.4.16
kernel on the testhost runs fine. If I choose Linux-2.4.16-kgdb from the
lilo prompt, the testhost simply reboots bringing me back to the lilo
prompt.

I've followed the doc from kgdb.sourgeforge.net exactly. At least I
think so -- did it three times getting the same results.

The develhost is a i686-pc-linux-gnu (linux-2.4.16, glibc-2.2.4,
gcc-2.95.3+glibc-2-patch) LFS system. 
The testhost is a fairly old Slackware 7.0.0 system. Here I've upgraded
the modutils to 2.4.6, and the kernel ( of course ).

Furtheron has the develhost his root on /dev/hda1 whereas the testhost
has it on /dev/hdb1. Running ``rdev bzImage-kgdb /dev/hdb1'' didn't
change anything ( shouldn't using lilo ).
Here is the lilo.conf section for the kgdb kernel:

	image=bzImage-kgdb
	  root=/dev/hdb1
	  labe=Linux-kgdb
	  read-only
	  append="gdb gdbttyS=0 gdbbaud=115200"

Any idea?
Thanks in advance
Frank


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux