This is the mail archive of the gdb@sourceware.org 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]

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


On Thu, Mar 22, 2007 at 11:29:14PM +0800, Xu Haojun-a18535 wrote:
> Hello, gdb experts.
> 
> Recently we are trying to stepping into shared-library on arm board
> using GDB 6.3 with gdbserver
> 
> First we find ld-linux.so 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.

I suggest you have two copies of your root filesystem.  Point GDB at
one on your host that is not stripped, and run one that is exactly the
same but stripped on the target.  Then everything will work much
better.

> 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?

It needs to know what function it's in to recognize shared library
trampolines.  Without symbols, it's not going to work.

A compromise which might help is to use strip -g for ld.so and
libpthread.so on your target instead of strip; that will leave the
symbol tables, and remove only the debug info.

-- 
Daniel Jacobowitz
CodeSourcery


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