From: Pedro Alves <palves@redhat.com>
To: "Carlos O'Donell" <carlos@redhat.com>,
Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: libc-alpha@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [libc patch] __tls_get_addr with link_map * instead of modid
Date: Fri, 24 Oct 2014 15:56:00 -0000 [thread overview]
Message-ID: <544A76AE.8040107@redhat.com> (raw)
In-Reply-To: <544A60A5.4020701@redhat.com>
On 10/24/2014 03:22 PM, Carlos O'Donell wrote:
> I don't understand the tradeoffs, but if calling dlopen() in the inferior would
> have made life easy, then I would have done that first, regardless of the impact
> on the inferior. Only if users complained or found use cases where things broke
> would I have fallen back on the "technical purist" solution involving doing
> everything yourself. Those are decisions that you, as a gdb developer need to
> make, or reevaluate and make different.
Off the top of my head, I'm sure there are more:
- The user might want to evaluate an expression while the program itself
has just called dlopen and is now stopped inside it. This pesky dlopen
recursion thing. ;-) It's best if GDB only calls async-signal
safe functions behind the scenes, if possible. Of course if the
injected expression involves calls to async-signal unsafe code that breaks
the inferior, the user gets what she asked for.
- The program might have not been linked with -ldl.
- I suspect there may be issues with messing with symbol resolution
and self library walks in the inferior too. Not sure if RTLD_LOCAL is
enough. dlmopen might be a better fit, but hmm, that isn't very
well supported in GDB/glibc.
- A lower level mechanism has much better changes of working on
more targets and runtimes of languages other than C with minimal
changes.
Thanks,
Pedro Alves
prev parent reply other threads:[~2014-10-24 15:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-18 20:15 Jan Kratochvil
2014-10-18 21:20 ` Rich Felker
2014-10-18 21:27 ` Jan Kratochvil
2014-10-18 21:44 ` Rich Felker
2014-10-23 10:03 ` Alexandre Oliva
2014-10-23 12:52 ` Jan Kratochvil
2014-10-24 1:47 ` Mike Frysinger
2014-10-24 2:21 ` Carlos O'Donell
[not found] ` <20141024093834.GA24090@host2.jankratochvil.net>
2014-10-24 14:22 ` Carlos O'Donell
2014-10-24 14:40 ` Jan Kratochvil
2014-10-24 15:00 ` Carlos O'Donell
2014-10-25 5:55 ` Rich Felker
2014-10-25 6:14 ` Jan Kratochvil
2014-10-25 6:26 ` Rich Felker
2014-10-24 15:56 ` Pedro Alves [this message]
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=544A76AE.8040107@redhat.com \
--to=palves@redhat.com \
--cc=carlos@redhat.com \
--cc=gdb-patches@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