Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] About remote debugging and library stripping
Date: Sun, 21 Oct 2012 20:27:19 +0200	[thread overview]
Message-ID: <20121021202719.6c7e0a5d@skate> (raw)
In-Reply-To: <20121019091857.GA24434@mail.sceen.net>

Richard,

Thanks a lot for this status.

On Fri, 19 Oct 2012 11:18:57 +0200, Richard Braun wrote:

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

Can you conclude with what you think are the steps needed to get these
things right?

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2012-10-21 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19  9:18 [Buildroot] About remote debugging and library stripping Richard Braun
2012-10-21 18:27 ` Thomas Petazzoni [this message]
2012-10-22 14:44   ` Richard Braun
2012-10-22 15:04     ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121021202719.6c7e0a5d@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox