LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   how to set up kgdb for 2.6.30 kernel (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-set-up-kgdb-for-2-6-30-kernel-742064/)

cracorange 07-22-2009 04:46 PM

how to set up kgdb for 2.6.30 kernel
 
Hi I'd like to set up kgdb for 2.6.30 kernel.
Besides that, I have a question : is there a chance that 2.6.30 may run with a Hardy 8.04 distrib, in place of 2.6.24 original kernel ?

I hope so ...
Anyway, I've launched a kernel compilation 2,5 hour ago that should finish soon, just setting some options to use kgdb via menuconfig .

I think there are no more patches to apply to the kernel, am I right ?

If the build is finally ok, what should I do with this kernel ?
Use it on this machine (target) and put the sources on the other one (running kgdb) or run kgdb on this machine and put the kernel on the other one ?

Actually I've not really well understood that as you can guess it ...
Thanks for your help :)

cracorange 07-23-2009 05:31 PM

Hi,
I've finally compiled 2.6.30 kernel with kgdb support.
I thought the kernel would wait while booting for a remote connection through kgdb, but actually it boots till the end and Gnome starts.
What should I do to make kgdb work ?
thanks for your help

syg00 07-23-2009 08:48 PM

There is a docbook template for kgdb in the source tree. Start with the README file (always a good idea) at the top level of your source tree.

cracorange 07-26-2009 04:37 AM

Hi,
Thanks for your help,
How do you get pdf or html out of .tmpl files, for instance in Documentation/DocBook directory, within kernel source directory .
I tried to type make, then tried make pdfdocs, but none of these commands worked

pachu 07-27-2009 04:38 AM

Hello,
I was trying something similar. Were you able to bring up the KGDB on the 2.6.30 kernel ?

I have a very basic question. In the KGDB docs (kgdbquickstart-2.4.pdf)
i see that they mention, in page 1, item 1 & 2, that the patch is for 2.6.15 .. does this mean that we cannot use KGDB for debugging the 2.6.30 kernel ? should the kernel which is to be debugged, be of a version equal to 2.6.15 and lesser ?

what should be the tool chain versions ?
thanks and regards
pachu

cracorange 07-27-2009 03:34 PM

The documentation you read is no more useful.
There is no need anymore to patch the kernel, just download the sources, for instance from kernel.org, go in the root directory of the sources and
then use either make xconfig or make menuconfig or something else to configure the kernel , ie set the options of the kernel .
You should go in Kernel Hacking sub-menu and select these options:
[*] Kernel debugging <-- not sure about this one [*] Compile the kernel with debug info[*] Compile the kernel with frame pointer[*] KGB: kernel debugging with remote gdb --->[*] KGDB: use kgdb over the serial console

and also that:
Device Drivers --->
Character Devices --->
Serial Drivers ---->
<*> 8250/16550 and compatible serial support[*] Console on 8250/16550 and compatible serial port


And I think that's it for the configuration step .

Then you have ti type make, the make modules_install and make install .
You'll have to check if your bootloader (grub, lilo or something else) has added an entry relative to the kernel you want to use,
and use correct kernel command line in this entry .
For instance in /boot/grub/menu.lst, I use this entry :

title linux 2.6.30 ( Kgdb )

root (hd0,4)

kernel /boot/vmlinuz-2.6.30 root=/dev/sda5 ro kgdb=ttyS0,38400 kgdboc=ttyS0,38400 kgdbwait

initrd /boot/initrd-2.6.30.img


You reboot, and if it should work nice, the kernel should wait for a serial connection from another machine with gdb.

Bye

nickcheng 08-10-2009 05:08 AM

Hi cracorange,
Thanks for your info.
It helps me to solve my half question.
But what would you do on the development machine?
Do you use gdbmod-2.* ./vmlinux or gdb ./vmlinux?
I would like to debug the driver modules but I am really confised by the docs I got from the internet.
Thank you,


All times are GMT -5. The time now is 11:27 AM.