LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 04-24-2013, 06:28 PM   #1
Matt_M
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
Question How to configure kgdb with Grub2?


I need to setup a kernel debug session so that I can peek & poke some registers on a PCIe HW device. I am using Ubuntu 12.04, which uses Grub2. Based on my /boot/config-3.5.0-23-generic file, the kernel was already built with KGDB support, but apparently not with kgdb-over-ethernet support. I tried building a new kernel to enable kgdboe (my target PC doesn't have an external COM port), but apparently this is no longer supported. Please correct me if I'm wrong on this, as I would really like to use ethernet if possible.

Now for the real problem: I'm trying to figure out how to modify my Grub2 config file to add an entry for KGDB. The only tutorials I've been able to find on this all refer to legacy Grub-style syntax for doing this:

Code:
title 2.6.15.5-kgdb
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.15.5-kgdb ro root=/dev/hda1 kgdbwait kgdb8250=1,115200
The syntax for Grub2 is clearly different, as it appears the "kernel" command has been replaced with "linux", and I see a variety of other differences as well. This gives me little hope for expecting the old syntax to "just work".

I have not been able to find any instructions for configuring KGDB with Grub2 online. What is the correct way to do this? Could some one provide a sample using Grub2 syntax?

Thanks!
 
Old 04-30-2013, 07:29 PM   #2
gdizzle
Member
 
Registered: Jul 2012
Posts: 208

Rep: Reputation: Disabled
Hi have you tried adding an entry in the 40_custom file?

https://help.ubuntu.com/community/Grub2#Custom
http://www.maketecheasier.com/master...way/2009/11/19

Heres an example of an entry in 40_custom

Next edit

Code:
/etc/grub.d/40_custom
#At the bottom of this file add the following

menuentry "Tiny Core Linux" {
set root='(hd0,1)'
linux /tce/boot/bzImage quiet
initrd /tce/boot/tinycore.gz
}
Code:
update-grub
:

To apply the settings to grub2.

Let us know how you go..
 
Old 05-01-2013, 12:34 AM   #3
Matt_M
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks gdizzle for following up on this! I am out of the office this week for a conference, so won't be able to play with this again until Monday. I will try making my best guess at adding the kgdb parameters to the 40_custom file, and see if I get lucky. Hopefully the COM port connector I ordered will have arrived by then as well -- I can't really know if I've made the correct Grub entry until I see the serial connection working.

If anybody has recent experience with kernel module debugging on Ubuntu (or any other distro using Grub2), I would like to hear what works for you. It seems that all the "how-to" instructions for kernel debugging are a bit out of date.

Also, I'm not sure if I've picked the best forum for this kind of question -- if anybody knows of another forum I should try please let me know!

Thanks, Matt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
configure Grub2 to boot FreeBSD cccc Debian 5 06-26-2012 11:48 AM
kcm-grub2 - No valid GRUB2/BURG installation could be detected cristi92b Linux - Newbie 2 06-14-2012 09:01 AM
[SOLVED] Is it possible to configure GRUB2 booting time? darthpinguim Linux - Newbie 5 02-11-2011 07:32 AM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 03:39 PM
grub2 ./configure error nwtlnxqstns Linux - Newbie 3 07-07-2010 09:41 PM


All times are GMT -5. The time now is 11:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration