public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Markus Metzger via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v4] gdb, gdbserver: support dlmopen()
Date: Tue, 01 Mar 2022 12:10:44 -0700	[thread overview]
Message-ID: <87wnhdjxor.fsf@tromey.com> (raw)
In-Reply-To: <20211117142812.3685162-1-markus.t.metzger@intel.com> (Markus Metzger via Gdb-patches's message of "Wed, 17 Nov 2021 15:28:12 +0100")

>>>>> "Markus" == Markus Metzger via Gdb-patches <gdb-patches@sourceware.org> writes:

Markus> This patch was originally developed by H.J.  Last version:
Markus> https://sourceware.org/pipermail/gdb-patches/2021-October/182353.html

Hi.  Thanks to you and HJ for doing this -- dlmopen has long been a hole
in gdb.

Markus> +  /* There may be different instances of the same library, in different
Markus> +     namespaces.  Each instance, however, must have been loaded at a
Markus> +     different address so its relocation offset would be different.  */
Markus> +  const lm_info_svr4 *lmg = (const lm_info_svr4 *) gdb->lm_info;
Markus> +  const lm_info_svr4 *lmi = (const lm_info_svr4 *) inferior->lm_info;
Markus> +
Markus> +  return (lmg->l_addr_inferior == lmi->l_addr_inferior);

Can you explain how objfile handling works?

I'd suspect that just a single objfile will be made for a given .so.
But, if that comment is correct (I think it is) then that would be
wrong, because an objfile has to know the correct runtime offset.

Maybe I'm mistaken about how the objfiles are created.
That would be good...

thanks,
Tom

  parent reply	other threads:[~2022-03-01 19:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 14:28 Markus Metzger
2022-01-21 11:42 ` Metzger, Markus T
2022-03-01 19:10 ` Tom Tromey [this message]
2022-03-09 12:23   ` Metzger, Markus T
2022-03-03 18:32 ` Pedro Alves
2022-03-09 12:24   ` Metzger, Markus T
2022-03-09 14:15     ` Pedro Alves
2022-03-29 16:13       ` Metzger, Markus T
2022-04-08 12:40         ` Metzger, Markus T
2022-05-25 17:12 ` Kevin Buettner
2022-05-31  9:29   ` Metzger, Markus T
2022-05-31 18:44     ` Ben Woodard
2022-05-24 18:40 Ben Woodard

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=87wnhdjxor.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).