This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Help with stepping into shared-library with stripped ld-linux on arm board

Hello, gdb experts.

Recently we are trying to stepping into shared-library on arm board
using GDB 6.3 with gdbserver

First we find is stripped so that gdb cannot insert a
breakpoint at _dl_debug_state. Then it has to continue with SINGLE_STEP
out of the linker codes, which is quite slow!!
Then one option we used is to re-compile the glibc with symbol info and
put it into arm board, then it works.

But that's not final one, because eventually all the libs and exes in
arm board have to be pre-linked for performance, so we have to figure
out ways to debug shared-library with a stripped & pre-linked ld-linux.
What we did is modify the enable_break() in solib-srv4.c and return a
hard-coded address for _dl_debug_state, since it is pre-linked and the
address is known.
But it turns out not work, and it looks gdb still has to continue with
SINGLE_STEP out of the linker codes. I checked the gdbserver using
strace, it looks the breakpoint in LD is inserted using PTRACE_POKETEXT
in the correct address, don't know why it not work.

Any clue about this? What makes gdb decide to send SINGLE_STEP or CONT
to gdbserver during stepping into a shared library? It looks it keep
sending SINGLE_STEP command to gdbserver, till out of linker code. Do I
miss something besides enable_break() in solib-srv4.c?

Your help is greatly appreciated!

Best Regards

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]