Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* cross-debugging with gdbserver, why can't gdb find breakpoint function?
@ 2003-07-17 20:01 David Wuertele
  2003-07-17 20:20 ` Jon Ringle
  0 siblings, 1 reply; 7+ messages in thread
From: David Wuertele @ 2003-07-17 20:01 UTC (permalink / raw)
  To: gdb; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 20:01 cross-debugging with gdbserver, why can't gdb find breakpoint function? David Wuertele
@ 2003-07-17 20:20 ` Jon Ringle
  2003-07-17 20:30   ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Ringle @ 2003-07-17 20:20 UTC (permalink / raw)
  To: gdb


On Thursday 17 July 2003 04:00 pm, David Wuertele wrote:
> 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?
>
this worked for me on my arm crossgdb:

(gdb) set solib-absolute-prefix /dev/null
(gdb) set solib-search-path /nfsroot/lib

Jon


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 20:20 ` Jon Ringle
@ 2003-07-17 20:30   ` Daniel Jacobowitz
  2003-07-17 20:37     ` Jon Ringle
  2003-07-18  0:32     ` David Wuertele
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-07-17 20:30 UTC (permalink / raw)
  To: gdb

On Thu, Jul 17, 2003 at 04:20:38PM -0400, Jon Ringle wrote:
> 
> On Thursday 17 July 2003 04:00 pm, David Wuertele wrote:
> > 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?
> >
> this worked for me on my arm crossgdb:
> 
> (gdb) set solib-absolute-prefix /dev/null
> (gdb) set solib-search-path /nfsroot/lib

Please, don't do it that way.  For David's setup the right way is:
(gdb) set solib-absolute-prefix /nfsroot

If you can point to somewhere you looked in the documentation and
didn't see this, I'd love to improve it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 20:30   ` Daniel Jacobowitz
@ 2003-07-17 20:37     ` Jon Ringle
  2003-07-17 21:07       ` Jon Ringle
  2003-07-18  0:32     ` David Wuertele
  1 sibling, 1 reply; 7+ messages in thread
From: Jon Ringle @ 2003-07-17 20:37 UTC (permalink / raw)
  To: gdb

On Thursday 17 July 2003 04:30 pm, Daniel Jacobowitz wrote:
> On Thu, Jul 17, 2003 at 04:20:38PM -0400, Jon Ringle wrote:
> > On Thursday 17 July 2003 04:00 pm, David Wuertele wrote:
> > > 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?
> >
> > this worked for me on my arm crossgdb:
> >
> > (gdb) set solib-absolute-prefix /dev/null
> > (gdb) set solib-search-path /nfsroot/lib
>
> Please, don't do it that way.  For David's setup the right way is:
> (gdb) set solib-absolute-prefix /nfsroot
>
> If you can point to somewhere you looked in the documentation and
> didn't see this, I'd love to improve it.

(gdb) help set solib-search-path
Set the search path for loading non-absolute shared library symbol files.
This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.

The help here doesn't imply that /lib will be suffixed to the 
solib-search-path setting...


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 20:37     ` Jon Ringle
@ 2003-07-17 21:07       ` Jon Ringle
  2003-07-17 22:35         ` Kevin Buettner
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Ringle @ 2003-07-17 21:07 UTC (permalink / raw)
  To: gdb

On Thursday 17 July 2003 04:37 pm, Jon Ringle wrote:
> On Thursday 17 July 2003 04:30 pm, Daniel Jacobowitz wrote:
> > On Thu, Jul 17, 2003 at 04:20:38PM -0400, Jon Ringle wrote:
> > > On Thursday 17 July 2003 04:00 pm, David Wuertele wrote:
> > > > 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?
> > >
> > > this worked for me on my arm crossgdb:
> > >
> > > (gdb) set solib-absolute-prefix /dev/null
> > > (gdb) set solib-search-path /nfsroot/lib
> >
> > Please, don't do it that way.  For David's setup the right way is:
> > (gdb) set solib-absolute-prefix /nfsroot
> >
> > If you can point to somewhere you looked in the documentation and
> > didn't see this, I'd love to improve it.
>
> (gdb) help set solib-search-path
> Set the search path for loading non-absolute shared library symbol files.
> This takes precedence over the environment variables PATH and
> LD_LIBRARY_PATH.
>
> The help here doesn't imply that /lib will be suffixed to the
> solib-search-path setting...

Ahh... I think I see now:

(gdb) help set solib-search-path
Set the search path for loading non-absolute shared library symbol files.
This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.
(gdb) help set solib-absolute-prefix
Set prefix for loading absolute shared library symbol files.
For other (relative) files, you can add values using `set solib-search-path'.

The term 'absolute' here refers to an 'absolute path'.

Is this correct?

Jon


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 21:07       ` Jon Ringle
@ 2003-07-17 22:35         ` Kevin Buettner
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Buettner @ 2003-07-17 22:35 UTC (permalink / raw)
  To: Jon Ringle, gdb

On Jul 17,  5:06pm, Jon Ringle wrote:

> > (gdb) help set solib-search-path
> > Set the search path for loading non-absolute shared library symbol files.
> > This takes precedence over the environment variables PATH and
> > LD_LIBRARY_PATH.
> >
> > The help here doesn't imply that /lib will be suffixed to the
> > solib-search-path setting...
> 
> Ahh... I think I see now:
> 
> (gdb) help set solib-search-path
> Set the search path for loading non-absolute shared library symbol files.
> This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.
> (gdb) help set solib-absolute-prefix
> Set prefix for loading absolute shared library symbol files.
> For other (relative) files, you can add values using `set solib-search-path'.
> 
> The term 'absolute' here refers to an 'absolute path'.
> 
> Is this correct?

Yes.

That help message isn't worded very well, is it?

Kevin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cross-debugging with gdbserver, why can't gdb find breakpoint function?
  2003-07-17 20:30   ` Daniel Jacobowitz
  2003-07-17 20:37     ` Jon Ringle
@ 2003-07-18  0:32     ` David Wuertele
  1 sibling, 0 replies; 7+ messages in thread
From: David Wuertele @ 2003-07-18  0:32 UTC (permalink / raw)
  To: gdb

Daniel> Please, don't do it that way.  For David's setup the right way
Daniel> is: (gdb) set solib-absolute-prefix /nfsroot

Thanks, this solved it for me.

Daniel> If you can point to somewhere you looked in the documentation
Daniel> and didn't see this, I'd love to improve it.

The first place I looked was to google for the error message:
"warning: Unable to find dynamic linker breakpoint function."  This
found a bunch of people who asked the same or a similar question, but
no answers anything remotely like yours.

My next step was to search for keywords in that error message in the
info files.  Didn't find anything there either.  Then I tried
READMEs.  Then I tried this group.

If there were a "troubleshooting" page in the manual that included
error messages mapped to suggestions, it would have been simple.

Thanks again,
Dave


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-07-18  0:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17 20:01 cross-debugging with gdbserver, why can't gdb find breakpoint function? David Wuertele
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox