unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
To: Andreas Schwab <schwab@linux-m68k.org>,
	Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	Pedro Alves <palves@redhat.com>,
	"Jeremy Stenglein \(jstengle\)" <jstengle@cisco.com>,
	"xe-linux-external\(mailer list\)" <xe-linux-external@cisco.com>
Subject: Re: [RFC PATCH 0/3] implement dlmopen hooks for gdb
Date: Tue, 22 Sep 2020 15:13:48 -0400	[thread overview]
Message-ID: <d61b405d-503a-7d9e-be4e-c38d613e1b18@redhat.com> (raw)
In-Reply-To: <87ft79ptg9.fsf@igel.home>

On 9/22/20 2:17 PM, Andreas Schwab wrote:
> On Sep 22 2020, Carlos O'Donell via Libc-alpha wrote:
> 
>> Yes, absolutely, I agree completely, for it to be useful the semantics
>> have to be:
>>
>> - If you detect a given symbol foo@GLIBC_DEBUG, then the feature is
>>   present and has the semantics you expect.
>>
>> - If you want new semantics then you need to make a foo2@GLIBC_DEBUG
>>   with the new semantics.
>>
>> What are the runtime semantics of the symbol? How do you access it?
> 
> Isn't that the same situation as libthread_db?

Yes, but coupled to libc.so, and doesn't require finding and loading
another matching library.

Taking that direction would mean creating a symbol in libthread_db.
In this particular case the symbol would provide the address of
the new structure that you could walk that contains the namespace
lists (that themselves contain linkmap lists).

In my opinion we should be heading towards the complete removal of
libthread_db from glibc because as an interface it requires that
the debugger load a library from a potentially untrusted filesystem
(or container) and execute code in order to debug the process.

I would rather see data-driven approaches where foo@GLIBC_DEBUG is
a data symbol and exposes a structure that can be walked to gather
information about the inferior.

It is also difficult if not impossible for a kernel-side agent to
run target code from libthread_db to resolve the result.

Keeping the symbol in libc.so avoids any debugger having to
locate the matching libthread_db, which is not always in the same
place as the library.

In summary:
- Use data symbols.
- Avoid needing to run code to resolve result.
- Keeps interface matched and in libc.so.

-- 
Cheers,
Carlos.


  reply	other threads:[~2020-09-22 19:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 19:32 [RFC PATCH 0/3] implement dlmopen hooks for gdb Daniel Walker via Libc-alpha
2020-06-26 21:17 ` Carlos O'Donell via Libc-alpha
2020-07-23 18:40   ` Daniel Walker (danielwa) via Libc-alpha
2020-07-23 21:20     ` Carlos O'Donell via Libc-alpha
2020-09-16 16:18       ` Daniel Walker (danielwa) via Libc-alpha
2020-09-17 12:52         ` Carlos O'Donell via Libc-alpha
2020-09-17 12:59           ` Florian Weimer via Libc-alpha
2020-09-17 13:53             ` Carlos O'Donell via Libc-alpha
2020-09-18 15:35               ` Daniel Walker (danielwa) via Libc-alpha
2020-09-18 15:40                 ` Florian Weimer via Libc-alpha
2020-09-21 20:02                   ` Daniel Walker (danielwa) via Libc-alpha
2021-07-28 18:33                   ` Daniel Walker via Libc-alpha
2021-07-28 18:48                     ` H.J. Lu via Libc-alpha
2020-09-17 13:52           ` Carlos O'Donell via Libc-alpha
2020-09-22 17:06       ` Florian Weimer via Libc-alpha
2020-09-22 17:28         ` Carlos O'Donell via Libc-alpha
2020-09-22 17:37           ` Florian Weimer via Libc-alpha
2020-09-22 17:59             ` Carlos O'Donell via Libc-alpha
2020-09-22 18:04               ` Florian Weimer via Libc-alpha
2020-09-22 18:41                 ` Carlos O'Donell via Libc-alpha
2020-09-22 18:44                   ` Florian Weimer via Libc-alpha
2020-09-22 18:46                     ` Carlos O'Donell via Libc-alpha
2020-09-22 18:17               ` Andreas Schwab
2020-09-22 19:13                 ` Carlos O'Donell via Libc-alpha [this message]
2020-06-26 21:30 ` Florian Weimer via Libc-alpha
2020-06-27  1:10   ` Daniel Walker (danielwa) via Libc-alpha
2020-07-02 13:54     ` Conan Huang (conhuang) via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=d61b405d-503a-7d9e-be4e-c38d613e1b18@redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=jstengle@cisco.com \
    --cc=palves@redhat.com \
    --cc=schwab@linux-m68k.org \
    --cc=xe-linux-external@cisco.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).