Troubleshooting
  Home
  Introduction
  Getting KGDB
  Documentation
  Using KGDB
  Credits
  Miscellaneous
  Troubleshooting
  FAQ
  Copyright
  About KGDB
  GEEks of Pune (GEEP)

 

Connection problems
gdb prints following errors on giving command target remote.
Ingore packet error, continuing...
Ingore packet error, continuing...
Ingore packet error, continuing...
Couldn't establish connection to remote target
Malform response to offset query, timeout.

  • Check whether the serial line speed given to the test kernel from lilo.conf file on the test machine is same as the serial line speed on the developement machine. They should be equal.
  • Check whether the serial line is working properly. Boot the test machine in a non-debug kernel and check whether characters sent into the serial line from either end of the serial line appear on the other end. This can be done as follows:
    • Boot the test machine with the kernel that came with redhat installation. On the developement machine run cat < /dev/ttyS0. It will wait for some characters to come from the serial line.
    • On the test machine run echo hello> /dev/ttyS0
    • The cat running developement machine machine should show "hello". There could be some extra end of lines. Ignore them.
    • Now kill the cat and repeat the same procedure with cat on the test machine and echo on developement machine. This time the cat on test machine should show "hello".

    • If either of the machines don't show hello you know that characters are not being sent. Check the serial line to see whether you have wired it incorrectly if that is the case.
  • Check whether the prompt send by kgdb is received on the developement machine. This can be done as follows:
    • Run minicom on the serial line on the developement machine. Setup serial line baud rate to appropriate value.
    • Now boot the test kernel.
    • When the message Waiting for connection from remote gdb... appears on the console of the test machine, following characters should be seen in minicom.  +$S05#b8. This character string may repeat. It is the prompt sent to gdb from kgdb. If you don't see this serial line speed is set incorrectly on one of the machines.
    Problems with breakpoints
    A breakpoint does not get hit as expected: Check whether you are using appropriate vmlinux file.
  • Print the address of the function sys_close from gdb:
    • (gdb) p sys_close
      $1 = {long int (unsigned int)} 0xc013212c <sys_close>
  • Print address of the same function using proc filesystem on the test machine.
    • $ grep sys_close /proc/ksyms
      c013212c sys_close_Rsmp_268cc6a2
    The the address is not same, c013212c in above case, vmlinux file being used is incorrect.