Dear All,<div><br><div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div> There is a problem with the KGDB at the very first break point after executing the gdb command "target remote /dev/ttyS0" from the host.</div>
<div> I have verbatim, followed the KGDB document <a href="http://kernel.org/pub/linux/kernel/people/jwessel/kdb/" target="_blank">http://kernel.org/pub/linux/kernel/people/jwessel/kdb/</a></div><div><br></div><div>
Problem Logs:</div>
<div>---------------------</div><div><br></div><div>Details of my hardware and system software:</div><div>-------------------------------------------------------------------</div><div><br></div><div><b>Host (Development machine): </b></div>
<div> Intel Pentium IV Machine with Fedora Core 12 </div><div> Linux Version : 2.6.31.5-127.fc12.i686.PAE</div><div> gdb version : GNU gdb (GDB) Fedora (7.0-3.fc12)</div>
<div><br></div><div><b>Target:</b> </div><div> Intel Pentium IV Machine with Fedora Core 12</div><div> Customized Linux Version : 2.6.38 </div><div><br></div><div>Host is connected to Target via a null modem cable</div>
<div><br></div><div><b><i>Snapshot of .config of linux version 2.6.38 on the target </i></b></div><div><b><i><br></i></b></div><div># CONFIG_DEBUG_RODATA is not set</div><div><br></div><div><div>CONFIG_HAVE_ARCH_KGDB=y</div>
<div>CONFIG_FRAME_POINTER=y</div><div>CONFIG_DEBUG_INFO=y</div><div>CONFIG_KGDB=y</div><div>CONFIG_KGDB_SERIAL_CONSOLE=y</div><div>CONFIG_KGDB_LOW_LEVEL_TRAP=y</div></div><div><br></div><div><b><i>Grub config on the target machine</i></b></div>
<div><b><i><br></i></b></div><div><div>title Fedora (2.6.38)</div><div> root (hd0,0)</div><div> kernel /boot/vmlinuz-2.6.38 ro root=UUID=fb7800fb-cfe7-438d-bc7f-c153ba4353d1 LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us<b><i>console=ttyS0,115200n8 kgdboc=ttyS0 kgdbwai</i></b>t</div>
<div> initrd /boot/initrd-2.6.38.img</div></div><div><br></div><div><br></div><div>On power on of the target, linux kernel boots and the logs are seen on the minicom console of the host and it will wait for the gdb on the host to connect. Here is the last 4 lines of the logs seen on the minicom</div>
<div><br></div><div><div>Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled</div><div>serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A</div><div>00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A</div><div>kgdb: Registered I/O driver kgdboc.</div>
<div>kgdb: Waiting for connection from remote gdb..</div></div><div><br></div><div><b><i>--- Now I close the minicom console (Ctrl-A X) and start the gdb on the host. Here is the steps I follow. </i></b></div><div><b><i><br>
</i></b></div><div><b><i>On the host machine:</i></b></div><div><b><i><br></i></b></div><div><br></div><div><div style="font-style:italic;font-weight:bold">[root@localhost kgdb]# gdb vmlinux</div><div style="font-style:italic;font-weight:bold">
<br></div><div>GNU gdb (GDB) Fedora (7.0-3.fc12)</div><div>Copyright (C) 2009 Free Software Foundation, Inc.</div><div>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html" style="color:rgb(0, 0, 204)" target="_blank">http://gnu.org/licenses/gpl.html</a>></div>
<div>This is free software: you are free to change and redistribute it.</div><div>There is NO WARRANTY, to the extent permitted by law. Type "show copying"</div><div>and "show warranty" for details.</div>
<div>This GDB was configured as "i686-redhat-linux-gnu".</div><div>For bug reporting instructions, please see:</div><div><<a href="http://www.gnu.org/software/gdb/bugs/" style="color:rgb(0, 0, 204)" target="_blank">http://www.gnu.org/software/gdb/bugs/</a>>...</div>
<div>Reading symbols from /root/kgdb/vmlinux...done.</div><div><br></div><div style="font-style:italic;font-weight:bold">(gdb) set remotebaud 115200</div><div style="font-style:italic;font-weight:bold">(gdb) set debug remote 1</div>
<div style="font-style:italic;font-weight:bold">(gdb) target remote /dev/ttyS0</div><div style="font-style:italic;font-weight:bold">Remote debugging using /dev/ttyS0</div><div>Sending packet: $qSupported#37...Ack</div>
<div>Packet received:</div><div>Packet qSupported (supported-packets) is NOT supported</div><div>Sending packet: $Hg0#df...Ack</div><div>Packet received: OK</div><div>Sending packet: $?#3f...Ack</div><div>Packet received: S05</div>
<div>Sending packet: $Hc-1#09...Ack</div><div>Packet received: OK</div><div>Sending packet: $qC#b4...Ack</div><div>Packet received: QC01</div><div>Sending packet: $qAttached#8f...Ack</div><div>Packet received:</div><div>
Packet qAttached (query-attached) is NOT supported</div>
<div>Sending packet: $qOffsets#4b...Ack</div><div>Packet received:</div><div>Sending packet: $g#67...Ack</div><div>Packet received: 36000000ffffffff0abaffff20d98bc06c3f86de783f86de803ac8dd803f86de885747c00202000060000000680000007b00c8dd7b0086deffff0000ffff0000</div>
<div>Sending packet: $mc0475788,1#a4...Ack</div><div>Packet received: 0f</div><div>Sending packet: $mc0475788,8#ab...Ack</div><div>Packet received: 0faef889f6ff0d08</div><div>Sending packet: $mc0475788,7#aa...Ack</div><div>
Packet received: 0faef889f6ff0d</div><div style="font-style:italic;font-weight:bold">0xc0475788 in ?? ()</div><div>Sending packet: $qSymbol::#5b...Ack</div><div>Packet received:</div><div>Packet qSymbol (symbol-lookup) is NOT supported</div>
<div>(gdb) s</div></div><div><div><div>Cannot find bounds of current function</div><div>(gdb)</div></div></div><div><br></div><div> </div><div><b>Observation:</b> </div><div> <b>1.</b> Ideally the kernel being debugged should break at legitimate address and the corresponding line number should </div>
<div> be displayed instead of " <span style="font-style:italic;font-weight:bold">0xc0475788 in ?? ()". </span></div><div><span style="font-style:italic;font-weight:bold"><br></span></div>
<div><span style="font-style:italic;font-weight:bold"> 2. </span>On inspecting section header in vmlinux executable, I found the .text section address range is from </div><div><span style="font-style:italic;font-weight:bold"> 0xC1000000 to 0xC1326e58 </span> and no section's contents associate with the address 0xC0475788. </div>
<div><br></div><div> <b><i>3.</i></b> Hence on single stepping, gdb logs the error as<b style="font-style:italic"> "Cannot find bounds of current function"</b></div><div><b style="font-style:italic"><br>
</b></div><div> Humbly request you to help me in addressing this issue. </div><div><br></div><div>Thanks and Regards,<br>Prabhu</div><div><br></div></span></div></div>