Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Feb 2009 11:06:21 -0800
From:      "Peter Craft" <craft@alacritech.com>
To:        <freebsd-questions@freebsd.org>
Subject:   Re: KGDB connection failure - Please help, I'm desparate! (=> or desperate)
Message-ID:  <071201c99457$7c1eaae0$510a010a@alacritech.com>

next in thread | raw e-mail | index | archive | help

First off - Make that "desperate".  Sorry.

Second, an update..

I've modified remote.c in gdb to print the data coming across the
serial line.  When I boot with -d and enter "gdb" followed by "s", =
absolutely
nothing comes across the serial line - readchar times out every time.

If I then reboot without -d (with the same modified gdb running) and set =
console=3Dcomconsole
I see all of the expected console characters read by readchar.

So it appears that the gdb stub on the target isn't outputing any data =
to
the serial line whatsoever.  Again, I have KDB, DDB, and GDB set in the
configuration file and the sio flags set to 0x90 (I've tried 0xc0 as =
well)
in the loader.conf file.  Furthermore, when I boot with -d I see the
message:
    GDB: Current port: sio

Can anyone think of a reason why the target isn't outputting debug =
packets to
the serial port?  Can anyone suggest a method to debug a debugger?

Thanks


  ----- Original Message -----=20
  From: Peter Craft=20
  To: freebsd-questions@freebsd.org=20
  Sent: Friday, February 20, 2009 3:28 PM
  Subject: KGDB connection failure - Please help, I'm desparate!



  I've been trying for three days to get KGDB to work.

  I've followed the instructions here:
  =
http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kern=
eldebug-online-gdb.html

  and here:
  http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf

  without success.  Specifically, I've rebuilt my kernel with:
  makeoptions     DEBUG=3D-g                # Build kernel with gdb(1) =
debug symbols
  ..
  options         KDB
  options         DDB
  options         GDB

  My "boot.config" file contains -P and my /boot/loader.conf file =
contains:
  hint.sio.0.flags=3D"0x90"

  When I issue the "boot -d" on the target, the system breaks in to the =
"db" prompt
  as expected, at which point I enter "gdb" followed by "s".  All of =
which seems to
  work perfectly.

  On the debugger side I enter kgdb with "kgdb -r /dev/cuad0 -v =
kernel.debug"
  from the build directory and I get:

  Ignoring packet error, continuing...
  Ignoring packet error, continuing...
  Ignoring packet error, continuing...
  Couldn't establish connection to remote target
  Malformed response to offset query, timeout

  If I boot the remote system with "set console=3Dcomconsole", I'm able =
to communicate
  across the serial line as a console, so I believe that the serial =
ports and cable are
  functioning properly.  I just can't get gdb to connect.

  Can anyone offer any suggestion on what to try next?  Or tips on how =
to go
  about debugging the problem?  This is with FreeBSD 7.1.

  Thanks in advance,

  Pete



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?071201c99457$7c1eaae0$510a010a>