From: Teresa Rivas <teresa.rivas@cadenux.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: gdb debugging threads help
Date: Fri, 18 Nov 2005 14:38:00 -0000 [thread overview]
Message-ID: <1132324709.32154.34.camel@localhost.localdomain> (raw)
In-Reply-To: <1132324238.32154.30.camel@localhost.localdomain>
Also I tried a c in the gdb and I get this errors:
(gdb) c
Continuing.
Error while mapping shared library sections:
/lib/libc.so.0: No such file or directory.
Error while mapping shared library sections:
/lib/libpthread.so.0: No such file or directory.
Error while mapping shared library sections:
/lib/ld-uClibc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/libc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/ld-uClibc.so.0: No such file or directory.
Program exited normally.
(gdb) quit
so even when this libraries are in the target file system I am debugging
remote from my host so on my host these libraries do not exist
under /lib instead they are under target/fs/lib.
> > > on the target:
> > > # gdbserver :5234 simple
> >
> > Is gdbserver linked to libthread_db? Check the build log, or check the
> > gdbserver binary.
>
> I check the config.log and I have this errors when checking for the
> thread_db library:
>
> configure:1510: checking for libthread_db
> configure:1531: gcc -o conftest -g -O2 conftest.c -lthread_db 1>&5
> configure:1596: gcc -o conftest -g -O2 -rdynamic conftest.c
> -lthread_db 1>&5
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_pdwrite'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_pglobal_lookup'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_lsetfpregs'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_getpid'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_lsetregs'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_pdread'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_lgetfpregs'
> /usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../lib/libthread_db.so:
> undefined reference to `ps_lgetregs'
> collect2: ld returned 1 exit status
> configure: failed program was:
> #line 1589 "configure"
> #include "confdefs.h"
>
>
> I see that is wrong that looks for the thread_db library in my host
> libs, it should look in the target libs, so I add the param
> --libdir=/target/libs to the configure and now the config.log doesn't
> say any error about thread_db library and I can compile gdbserver fine.
>
> Which command can I use to see if it is linked against the correct
> thread_db library?? I use a nm -D gdbserver but all I see are the
> symbols from the dynamic libraries not the libraries.
>
> .....
> 0000eeec T target_signal_to_name
> 0000ee90 T target_signal_to_string
> U tcgetattr
> U tcsetattr
> U tcsetpgrp
> U td_symbol_list
> U td_ta_event_addr
> U td_ta_event_getmsg
> U td_ta_new
> U td_ta_set_event
> U td_ta_thr_iter
> U td_thr_event_enable
> U td_thr_get_info
> 0001f42c D the_low_target
> 00020784 B the_target
> 00014664 T thread_db_init
> 00020690 B thread_from_wait
> ......
>
> Now I get a different error from gdb:
>
> on the target:
>
> # gdbserver :5234 simple
> Process simple created; pid = 41
> Listening on port 5234
>
>
> on the host:
>
> GNU gdb 6.3
> Copyright 2004 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-linux --target=arm-linux".
> (gdb) set solib-absolute-prefix /lib
> (gdb) file simple
> Reading symbols
> from /home/trivas/dm320-appro/fs/examples/threads/simple...done.
> (gdb) target remote 192.168.200.199:5234
> Remote debugging using 192.168.200.199:5234
> 0x40000c60 in ?? ()
> warning: Unable to find dynamic linker breakpoint function.
> GDB will be unable to debug shared library initializers
> and track explicitly loaded dynamic code.
> (gdb) info shared
> No shared libraries loaded at this time.
> (gdb)
>
>
> > > (gdb) set solib-absolute-prefix /target/arm-linux/lib
> >
> > That's probably not right. The paths below solib-absolute-prefix
> > should match the target filesystem. So if solib-absolute-prefix
> > is "/target/arm-linux", then the target /lib/ld-linux.so.2 should be in
> > /target/arm-linux/lib/ld-linux.so.2.
> >
> > > (gdb) set solib-search-path /target/arm-linux/lib
> >
> > You should not need to set that.
> >
> > > (gdb) dir /target/arm-linux/lib
> >
> > Or this.
> >
> > > Source directories searched: /target/arm-linux/lib:$cdir:$cwd
> > > (gdb) set endian little
> > > The target is assumed to be little endian
> >
> > Or this.
> >
> > > (gdb) handle SIG32 nostop noprint pass
> > > Signal Stop Print Pass to program Description
> > > SIG32 No No Yes Real-time event 32
> >
> > Don't do that; it never helps.
> >
> > > (gdb) add-symbol-file simple
> > > add symbol table from file "simple" at
> > > (y or n) y
> > > Reading symbols
> > > from /home/trivas/dm320-appro/fs/examples/threads/simple...done.
> >
> > Don't do this either. Use "file simple", and do it before issuing the
> > "target remote" command.
> >
> > > and if I try a info shared it says "No shared libraries loaded at this
> > > time"
> >
> > Thread debugging will not work until this works. It should show you
> > the list of libraries and say that they have symbols loaded (at main,
> > not when you first connect).
> >
--
Teresa R. Rivas
teresa.rivas@cadenux.com
Cadenux, LLC
next prev parent reply other threads:[~2005-11-18 14:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-18 0:35 Teresa Rivas
2005-11-18 1:19 ` Jim Blandy
2005-11-18 2:36 ` Daniel Jacobowitz
2005-11-18 14:30 ` Teresa Rivas
2005-11-18 14:38 ` Teresa Rivas [this message]
2005-11-18 15:28 ` Daniel Jacobowitz
2005-11-18 16:49 ` Teresa Rivas
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=1132324709.32154.34.camel@localhost.localdomain \
--to=teresa.rivas@cadenux.com \
--cc=drow@false.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