Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: David Wuertele <dave-gnus@bfnet.com>
To: gdb@sources.redhat.com
Cc: gdb@gnu.org
Subject: cross-debugging with gdbserver, why can't gdb find breakpoint function?
Date: Thu, 17 Jul 2003 20:01:00 -0000	[thread overview]
Message-ID: <m3u19k2abf.fsf@bfnet.com> (raw)

I'm trying to debug a simple test program using gdbserver.  The test
program:

  #include <stdio.h>
  int main (int argc, char **argv) {
    printf ("hello, world!\n");
    return 0;
  }

The target architecture is mipsel.  The hello.c program was compiled
as follows:

  mipsel-linux-gcc -g -o hello hello.c

On the target, I run gdbserver-5.3 like this:

  # /usr/local/bin/gdbserver 0:8888 hello
  Process hello created; pid = 478

When I run gdb-5.0.91 on the dev host and try to connect, this is what
I get:

  # mipsel-linux-gdb
  Current directory is /nfsroot/root/
  GNU gdb 5.0.91-2001-10-15-cvs (MI_OUT)
  Copyright 2001 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or distribute copies of it under certain conditions.
  Type "show copying" to see the conditions.
  There is absolutely no warranty for GDB.  Type "show warranty" for details.
  This GDB was configured as "--host=i686-pc-linux-gnu --target=mipsel-linux".
  (gdb) file hello
  Reading symbols from hello...done.
  (gdb) target remote 192.168.0.159:8888
  Remote debugging using 192.168.0.159:8888
  0x2aaa9c90 in ?? ()
  warning: Unable to find dynamic linker breakpoint function.
  GDB will be unable to debug shared library initializers
  and track explicitly loaded dynamic code.

I tried upgrading the host gdb, and got a different problem:

  # ./gdb
  Current directory is /nfsroot/root/
  GNU gdb 2003-07-16-cvs
  Copyright 2003 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or distribute copies of it under certain conditions.
  Type "show copying" to see the conditions.
  There is absolutely no warranty for GDB.  Type "show warranty" for details.
  This GDB was configured as "--host=i386-pc-linux --target=mipsel-pc-linux".
  (gdb) file hello
  Reading symbols from hello...done.
  (gdb) target remote 192.168.0.159:8888
  Remote debugging using 192.168.0.159:8888
  remote.c:3440: internal-error: Attempt to fetch a non G-packet register when this remote.c does not support the p-packet.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.

That's weird that the gdb from the same source as gdbserver doesn't
know how to talk to gdbserver!  Looks like gdb-5.0.91 at least
understands the packets gdbserver-5.3 sends.  So I went and ran strace
on gdb-5.0.91 to see what it was trying to open.  Here is a snippet:

  open("/lib/ld.so.1", O_RDONLY)          = -1 ENOENT (No such file or directory)
  write(2, "warning: ", 9warning: )                = 9
  write(2, "Unable to find dynamic linker br"..., 148Unable to find dynamic linker breakpoint function.
  GDB will be unable to debug shared library initializers
  and track explicitly loaded dynamic code.) = 148

Why is gdb trying to open /lib/ld.so.1?  That /lib directory has
nothing to do with the target libs.  The target libs can be found in
/nfsroot/lib.  How do I tell gdb to look there instead of /lib?

Dave


             reply	other threads:[~2003-07-17 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-17 20:01 David Wuertele [this message]
2003-07-17 20:20 ` Jon Ringle
2003-07-17 20:30   ` Daniel Jacobowitz
2003-07-17 20:37     ` Jon Ringle
2003-07-17 21:07       ` Jon Ringle
2003-07-17 22:35         ` Kevin Buettner
2003-07-18  0:32     ` David Wuertele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3u19k2abf.fsf@bfnet.com \
    --to=dave-gnus@bfnet.com \
    --cc=gdb@gnu.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox