public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/dwarf: disable per-BFD resource sharing for -readnow objfiles
Date: Tue, 30 Mar 2021 13:33:16 -0400	[thread overview]
Message-ID: <67e736ad-7eec-1557-6575-d3679ad1d737@polymtl.ca> (raw)
In-Reply-To: <87a6qkvcuh.fsf@tromey.com>

On 2021-03-30 12:13 p.m., Tom Tromey wrote:> Simon> I think the most sensible fix would be to not share a dwarf2_per_bfd
> Simon> between two objfiles loaded with different methods.  That means that two
> Simon> objfiles sharing the same BFD and loaded the same way would share a
> Simon> dwarf2_per_bfd.  Two objfiles sharing the same BFD but loaded with
> Simon> different methods would use two different dwarf2_per_bfd structures.
> 
> It seems to me that -readnow is a funny situation, because it is
> intended to do something unusual.
> 
> For all other kinds of possible sharing, I think that deferring to
> whatever was already done and recorded in the per-BFD object should work fine.
> The idea here is just to bypass the reading step when possible.
> So IMO it's fine to ignore the index cache if the psymtabs have already
> been scanned -- reading from the cache won't give any benefits relative
> to reusing the per-BFD object.
> 
> This seems like it would mainly be an issue for the ordering of checks
> in dwarf2_initialize_objfile.  When I look there, it seems correct
> already though -- the existing per-BFD is checked before trying to do
> any scan or reading from the index cache.

Yes, that case works fine (because it was broken at first and a PR was
reported :)).  I would be curious what you think about the (still
theoritical) index -> psymtabs case mentioned here:

    https://sourceware.org/pipermail/gdb-patches/2021-March/177366.html

> 
> Simon> 	* dwarf2/read.c (dwarf2_has_info): Don't share dwarf2_per_bfd
> Simon> 	with objfiles using READNOW.
> 
> Thank you.  This looks good to me.  Thanks especially for the test case.

> I think the ChangeLog entry should probably mention the PR though.

Thanks, I will add that and push to both branches.

Simon

  reply	other threads:[~2021-03-30 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 20:03 [PATCH gdb-10-branch candidate] gdb/dwarf: disable per-BFD resource sharing Simon Marchi
2021-03-30 15:43 ` [PATCH v2] gdb/dwarf: disable per-BFD resource sharing for -readnow objfiles Simon Marchi
2021-03-30 16:13   ` Tom Tromey
2021-03-30 17:33     ` Simon Marchi [this message]
2021-03-30 19:55       ` Tom Tromey

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=67e736ad-7eec-1557-6575-d3679ad1d737@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --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).