From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: libc-alpha@sourceware.org, gdb@sourceware.org
Subject: Re: tcbhead_t gdb access for nonthreaded, gdb for longjmp()
Date: Wed, 13 Sep 2006 13:05:00 -0000 [thread overview]
Message-ID: <20060913130532.GA21977@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20060910142723.GA28131@nevyn.them.org>
Hi Daniel,
On Sun, 10 Sep 2006 16:27:24 +0200, Daniel Jacobowitz wrote:
> 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.
Is it fine to make `__libc_version' public?
`libthread_db' would check for it if running in `TD_MINIMALONLY' mode.
> I wonder if we really need to use libthread_db here anyway.
Besides longjmp() target PTR_DEMANGLE()ing there is also need to access glibc
TLS symbol `errno' but - in fact - AFAIK no other TLS symbol.
One may say there is no TLS `errno' for nonthreaded programs as they use only
(*__errno_location ())
But from the user perspective I consider not acceptable to say something like
No symbol "errno" in current context.
Also one cannot expect everyone will compile everything with bloated -ggdb3 to
automatically expand `errno' to `(*__errno_location ())'.
I see multiple solutions (maybe first one enough?).
* Hardcoding `#define errno (*__errno_location ())' into gdb.
* Providing full custom TLS resolving for gdb - no glibc change needed.
* Extending current glibc libthread_db for non-threaded inferiors.
(the patch sent before <20060908102235.GA31335@host0.dyn.jankratochvil.net>)
* Merging the basic libpthread part for TLS resolving into glibc core
as nonthreaded glibc is using the TLS support for threading anyway.
* Merging the whole libpthread to glibc, making libpthread just a stub,
forgetting there ever existed nonthreaded programs before,
the same way UP (vs. SMP) was forgotten.
...
> 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.
Nice idea.
Regards,
Jan
next prev parent reply other threads:[~2006-09-13 13:05 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
2006-09-13 13:05 ` Jan Kratochvil [this message]
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=20060913130532.GA21977@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--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