Skip to contentSkip to conversation

gdb problems

DISCUSSION Christopher R. Johnson 2 participants 3 messages Jan 27, 2004

lore
Share & tools
lore
#0 lore raw

Maybe not the right list for this, if you have a suggestion for somewhere better let me know...

My new tool chain build is working well, except that debugging with gdb/gdbserver is somewhat broken. I figured out that I needed thread_db and have that built in now and delivered to the target platform.

Problem #1: When I start host side gdb, I get the message:
warning: unable to find dynamic linker breakpoint function GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code

I don't need to debug initializers, so I set a breakpoint at main and continue. Two error messages appear:
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory
Error while mapping shared library symbols:
/lib/ld.so.1: No such file or directory

The program starts and breakpoint don't work.

Problem #2: (Maybe related?) on the target side gdbserver, after starting things with "c" on the host side, this message appears:
gdb: error initializing thread_db library.
gdb: error initializing thread_db library.

Yes, twice.

Why is the host side looking in /lib for target libraries? Can I control that? How?

Why is gdbserver on the target having trouble? I see I have correctly delivered the thread_db library in /lib on the target, so what gives?

Any help or guidance would be greatly appreciated. I build my toolchain with crosstools.

--
Christopher R. Johnson

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw

Ok, answering some of my own questions:

in host-side gdb, use the two commands:
set solib-absolute-prefix
set solib-search-path

I set the first to /dev/null and the second to the path where my filesystem is constructed and its /lib directory (where all my shared libs are on the host).

All the below error messages go away, but I am left with my original problem. I can set breakpoints but they don't work. What am I missing?

Quoted 32 lines · Christopher R. Johnson

Maybe not the right list for this, if you have a suggestion for somewhere better let me know...

My new tool chain build is working well, except that debugging with gdb/gdbserver is somewhat broken. I figured out that I needed thread_db and have that built in now and delivered to the target platform.

Problem #1: When I start host side gdb, I get the message:
warning: unable to find dynamic linker breakpoint function GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code

I don't need to debug initializers, so I set a breakpoint at main and continue. Two error messages appear:
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory
Error while mapping shared library symbols:
/lib/ld.so.1: No such file or directory

The program starts and breakpoint don't work.

Problem #2: (Maybe related?) on the target side gdbserver, after starting things with "c" on the host side, this message appears:
gdb: error initializing thread_db library.
gdb: error initializing thread_db library.

Yes, twice.

Why is the host side looking in /lib for target libraries? Can I control that? How?

Quoted 11 lines

Why is gdbserver on the target having trouble? I see I have correctly delivered the thread_db library in /lib on the target, so what gives?

Any help or guidance would be greatly appreciated. I build my toolchain with crosstools.

--
Christopher R. Johnson

--
Christopher R. Johnson
Principal Software Engineer
GCC Printers
(781)276-8763

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Christopher R. Johnson
Quoted 5 lines · In message <[email protected]> you wrote:

Problem #1: When I start host side gdb, I get the message:
warning: unable to find dynamic linker breakpoint function GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code

You missed to set solib-absolute-prefix - see
http://www.denx.de/twiki/bin/view/DULG/DebuggingApplication#Section_9.5.2.

Quoted 8 lines

The program starts and breakpoint don't work.

Problem #2: (Maybe related?) on the target side gdbserver, after starting things with "c" on the host side, this message appears:
gdb: error initializing thread_db library.
gdb: error initializing thread_db library.

Yes, twice.

Well, guess what that means?

Quoted 2 lines

Why is gdbserver on the target having trouble? I see I have correctly delivered the thread_db library in /lib on the target, so what gives?

Probably you have other problems with your build of GDB / gdbserver. We had to fix a couple of problems to get thread support working.

Quoted 2 lines

Any help or guidance would be greatly appreciated. I build my toolchain with crosstools.

Feel free to try out the GDB / gdbserver that come with the ELDK.

Best regards,

Wolfgang Denk

--
See us @ Embedded World, Nuremberg, Feb 17 - 19, Hall 12.0 Booth 440
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] The moral of the story is: "Don't stop to tighten your shoe laces during the Olympics 100m finals".
- Kevin Jones in <[email protected]>

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/