Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] About remote debugging and library stripping
@ 2012-10-19  9:18 Richard Braun
  2012-10-21 18:27 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Braun @ 2012-10-19  9:18 UTC (permalink / raw)
  To: buildroot

Hello,

There seems to be some confusion about what has to be done to get remote
debugging actually working with stripped libraries. It seems buildroot
avoids stripping libthread_db entirely, which was introduced by Mike
Frysinger (hello Mike) with c98bc88e3296222a20e59cfb7b9f3ec5aee3be1c.
If you're absolutely certain of this change, then please explain it.
In my experience (and some in-depth search in the sources), libthread_db
and libpthread can both be stripped.

To understand why this is possible, the big picture must get clearer.
First, for those who aren't aware of its existence, libthread_db is part
of the C library. Its purpose is to hide the implementation details of
the threading implementation through a well defined interface that GDB
and gdbserver can use. When gdbserver loads this library, it doesn't
need the debugging or local symbols. The libthread_db library can be
stripped as much as any other library.

This isn't the case for libpthread. As stated in the GDB FAQ [1],
libthread_db actually needs a few local symbols to work with its
libpthread counterpart. The libpthread library should only be stripped
from its debugging symbols (--strip-debug), not its local ones.

To make things even more complicated, gdbserver (and apparently only
gdbserver) has support for Linux threads since before 2008 [2], but
it's limited (you may get weird SIGTRAPs without understanding why).
This is important because currently, libthread_db isn't installed when
using the crosstool-ng backend.

In the hope this will help.

-- 
Richard Braun

[1] http://sourceware.org/gdb/wiki/FAQ
[2] http://sourceware.org/ml/gdb-patches/2007-10/msg00547.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-22 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19  9:18 [Buildroot] About remote debugging and library stripping Richard Braun
2012-10-21 18:27 ` Thomas Petazzoni
2012-10-22 14:44   ` Richard Braun
2012-10-22 15:04     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox