public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Aaron Merey via Gdb-patches <gdb-patches@sourceware.org>,
	Simon Marchi <simon.marchi@polymtl.ca>,
	lsix@lancelotsix.com
Subject: Re: [PATCH 2/3] gdb: Add soname to build-id mapping for corefiles
Date: Wed, 17 Nov 2021 16:16:13 -0500	[thread overview]
Message-ID: <CAJDtP-ThnxJZYXT5Tf7302nQGqHyoaDvF_DTvWbrVLb7rWkRrw@mail.gmail.com> (raw)
In-Reply-To: <877dd6euil.fsf@tromey.com>

Hi Tom,

On Wed, Nov 17, 2021 at 9:29 AM Tom Tromey <tom@tromey.com> wrote:
> If re-opening and then calling bfd_check_format sets the flags
> correctly, then I suppose the question is just why the call in
> build_file_mappings isn't doing that:
>
>             if (bfd == nullptr || !bfd_check_format (bfd, bfd_object))
>
> Possibly the answer is that corelow passes "binary" as the target, but
> your code does:
>
> Aaron> +  gdb_bfd_ref_ptr abfd = gdb_bfd_open (bfd->filename, gnutarget);
>
> But then I wonder why "binary" is appropriate in corelow.

Yes it would be much better if "bfd" was simply initialised with the proper
fields. Corelow treats bfds in a target-agnostic manner but this shouldn't
preclude having accurate information in "bfd".

We could force "bfd" to have a format of bfd_unknown and let
bfd_check_format figure out the correct format and fields.  This is
basically what I do in gdb_bfd_read_elf_soname.  But really there
should be a way to just initialise "bfd" with completely accurate
contents at the time of creation.  If this doesn't exist maybe now
is the time to add it.

Aaron


  reply	other threads:[~2021-11-17 21:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  1:47 [PATCH v4 0/3] Add debuginfod core file support Aaron Merey
2021-11-10  1:47 ` [PATCH 1/3] gdb: Add aliases for read_core_file_mappings callbacks Aaron Merey
2021-11-14  2:20   ` Simon Marchi
2021-11-17  3:39     ` Aaron Merey
2021-11-10  1:47 ` [PATCH 2/3] gdb: Add soname to build-id mapping for corefiles Aaron Merey
2021-11-14  2:36   ` Simon Marchi
2021-11-17  3:24     ` Aaron Merey
2021-11-17 14:17       ` Tom Tromey
2021-11-17 21:16         ` Aaron Merey [this message]
2022-01-26  1:40           ` Aaron Merey
2022-02-09  2:31             ` Aaron Merey
2022-02-17 16:01           ` Andrew Burgess
2021-11-10  1:47 ` [PATCH 3/3] PR gdb/27570: missing support for debuginfod in core_target::build_file_mappings Aaron Merey
2021-11-14  2:56   ` Simon Marchi
2021-11-17  3:28     ` Aaron Merey
2022-01-26  1:42       ` Aaron Merey
2022-02-09  2:31         ` Aaron Merey
  -- strict thread matches above, loose matches on Subject: below --
2021-08-12  4:24 [PATCH v3 0/3] Add debuginfod core file support Aaron Merey
2021-08-12  4:24 ` [PATCH 2/3] gdb: Add soname to build-id mapping for corefiles Aaron Merey
2021-08-15 14:51   ` Lancelot SIX
2021-08-17 13:58     ` Simon Marchi
2021-08-19  2:22       ` Aaron Merey
2021-09-29  1:12         ` Aaron Merey
2021-11-04  1:32         ` Simon Marchi

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=CAJDtP-ThnxJZYXT5Tf7302nQGqHyoaDvF_DTvWbrVLb7rWkRrw@mail.gmail.com \
    --to=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.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).