Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: libc-alpha@sourceware.org, gdb@sourceware.org
Subject: Re: tcbhead_t gdb access for nonthreaded, gdb for longjmp()
Date: Sun, 10 Sep 2006 14:27:00 -0000	[thread overview]
Message-ID: <20060910142723.GA28131@nevyn.them.org> (raw)
In-Reply-To: <20060908102235.GA31335@host0.dyn.jankratochvil.net>

Hi Jan, thanks for working on this.

On Fri, Sep 08, 2006 at 12:22:35PM +0200, Jan Kratochvil wrote:
> glibc part:
> 
>  * Provide some access to the `tcbhead_t.pointer_guard' field for gdb.
>    Currently implemented by `td_thr_getxregs' providing only `pointer_guard'.
>    New non-Solaris `td_thr_*' function could be provided instead.
> 
>  * All the `libthread_db' functions accessing inferior's `_thread_db*' symbols
>    of `libpthread' fallback to the new `_local_db*' symbols in `libthread_db'
>    itself. `libthread_db'<=>`libpthread' versions must match anyway.
>    I admit I do not know how may `libthread_db' and `libpthread' as there is
>    already required in `td_ta_new' their versions match.  Anyway it should be
>    enough for 99% of cases - as the fallback option.

Your new libthread_db will accept any version of glibc, even one which
does not match - that seems like a good way to get in a lot of trouble.

I wonder if we really need to use libthread_db here anyway.  The
original goal of libthread_db, as I understand it, was to abstract away
the internals of the threading library from its higher level concepts;
for instance, you weren't supposed to have to know how to map threads
to LWPs, or how to find the locks owned by a thread (on Solaris's,
glibc's doesn't implement that).  This is a C library internal, with
not much to do with threads except that most platforms happen to use a
TLS address.

We're interested in "is there a pointer guard" and "is it used for
the PC value in setjmp/longjmp".  We need both pieces of information,
because some targets do and some don't; ia64 only encrypts rp, for
instance, not sp or pc.  We could provide those two bits of constant
information in libc somewhere.

Alternatively, since I don't see anything else in glibc that mangles
pointers which GDB would need to know about (except maybe atexit
functions, which might be nice to display someday?) we could provide
a function in glibc which we could call that would return the target
of a jmp_buf.  Then GDB wouldn't have to know how PTR_MANGLE worked.

Glibc maintainers, does that last idea sound practical?  It's much
simpler.  It'll take up a dozen or so bytes at runtime, hopefully not
paged in depending where they're linked.


-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-09-10 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-08 10:29 Jan Kratochvil
2006-09-10 14:27 ` Daniel Jacobowitz [this message]
2006-09-13 13:05   ` Jan Kratochvil
2006-09-13 13:20     ` Daniel Jacobowitz
2006-09-13 18:37       ` Jan Kratochvil
2006-09-13 18:49         ` Daniel Jacobowitz

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=20060910142723.GA28131@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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