This is the mail archive of the
mailing list for the GDB project.
Re: Help with stepping into shared-library with stripped ld-linux on arm board
- From: Daniel Jacobowitz <drow at false dot org>
- To: Xu Haojun-a18535 <hjXu at motorola dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 22 Mar 2007 11:45:06 -0400
- Subject: Re: Help with stepping into shared-library with stripped ld-linux on arm board
- References: <6D989D7EEBF1A34EA5CAF6A24FD3E15801E3CB50@zmy16exm63.ds.mot.com>
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
> 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.