From mboxrd@z Thu Jan 1 00:00:00 1970 From: gprabhunath@gmail.com (Prabhu nath) Date: Thu, 12 May 2011 06:16:12 +0530 Subject: KGDB Setup problem Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Dear All / Spiro, I tried setting up KGDB on my machine but somehow I am not finding my luck for past few months. Sprio. in his earlier mail had said about his success of setting up KGDB, Can you please share your notes of how to set up KGDB. If possibe please share the screen shots. Let me feel happy about the gdb prompt. Following is my set up. I have two x86 single core machines. C1 and C2. C1 = target C2 = Host On Target I have built a custom kernel 2.6.34 with KGDB enabled. Here is the snapshot of my .config CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_INFO=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_KGDB=y CONFIG_KGDB_SERIAL_CONSOLE=y My vmlinux is around 65MB. *Scenario 1:* I connected a null modem cable from C1 to C2. Tested the cable by redirecting the kernel boot logs from C1 to C2 thru the cable and cable is fine. I connected C1 to a LCD monitor (console=tty0) through a VGA cable so that I used tty0 to view normal kernel booting logs and null modem cable to work with debugger My grub.conf is title Fedora (2.6.34) root (hd0,1) kernel /vmlinuz-2.6.34 ro root=UUID=4a51e22e-ec12-469f-80ff-17afe3e6f15f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=tty0 kgdbwait kgdb8250=ttyS0,115200 initrd /initramfs-2.6.34.img *The result was, on booting up the kernel kgdb was not waiting. * *Scenario 2. *I connected a null modem cable from C1 to C2. Tested the cable by redirecting the kernel boot logs from C1 to C2 thru the cable and cable is fine. I connected C1 to a LCD monitor (console=tty0) through a VGA cable so that I tty0 to view normal kernel booting logs and null modem cable to work with debugger My grub.conf is title Fedora (2.6.34) root (hd0,1) kernel /vmlinuz-2.6.34 ro root=UUID=4a51e22e-ec12-469f-80ff-17afe3e6f15f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=tty0 kgdbwait kgdboc=ttyS0,115200 initrd /initramfs-2.6.34.img *The result is, on booting up the kernel kgdb is waiting for the input ( This log was seen on my LCD monitor) but Alt-SysRq-g did not work here to switch to the debugger * *Scenario 3:* I connected a null modem cable from C1 to C2. Tested the cable by redirecting the kernel boot logs from C1 to C2 thru the cable and cable is fine. My grub.conf is title Fedora (2.6.34) root (hd0,1) kernel /vmlinuz-2.6.34 ro root=UUID=4a51e22e-ec12-469f-80ff-17afe3e6f15f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=ttyS0,115200n8 kgdbwait kgdboc=ttyS0,115200 kgdbcon initrd /initramfs-2.6.34.img * The result is, on booting up the kernel kgdb is waiting for the input ( This log was seen on my minicom console) but Alt-SysRq-g did not work and it threw some garbage. * On the host side I executed the following commands. # gdb ./vmlinux (gdb) set remotebaud 115200 (gdb) target remote /dev/ttyS0 Some of the documents say that after executing the last command I should see the gdb prompt from where I can set breakpoints, single stepping, but didn't show up for me :( *Note:* If it really matters. I was working on my host machine through a putty session. Request you or anyone to bail me out from the clutches of this precarious problem. Thanks, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110512/746dca4b/attachment.html