public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Fix BZ 25065 - Ensure that physnames are computed for inherited DIEs
Date: Thu, 17 Oct 2019 05:30:00 -0000	[thread overview]
Message-ID: <dd3ec9ad-f017-b337-6a00-8379a5f4c79a@polymtl.ca> (raw)
In-Reply-To: <fd55a565-132b-5fca-dfa7-0682fe243a27@polymtl.ca>

On 2019-10-16 11:54 p.m., Simon Marchi wrote:
> I think that what's confusing in all this is the fact that the method_info list is
> currently attached to a particular CU.  Instead, I think it should be attached to the
> operation of processing of a CU, and used to collect all delayed method infos while
> processing that CU, even if some of these infos come from inherited DIEs from another
> CU.  Concretely, it would mean to have a local instance of
> std::vector<delayed_method_info> in process_full_comp_unit/process_full_type_unit and to
> pass it by pointer/reference through the call stack to any code who might want to append
> to it.  We wouldn't have to do anything special in inherit_abstract_dies, just pass this
> reference to the list down the stack.  I don't know how feasible it would be in practice
> to do that change, maybe it's too much work or would end up ugly.  I'll give it a try.
> But your patch gives essentially the same result, and works with what we have today.

A little follow up to the above.

I prototyped that change here in a WIP patch (so, not intended to be reviewed):

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/128

I got no regression in gdb.dwarf2.  However, it's a bit invasive.  If we want to pass other
objects in the same fashion, it will quickly become very heavy.

What we could do though, is to introduce a new type (e.g. struct dwarf2_cu_processing_context)
and pass that around instead.  Its lifetime would be the duration of process_full_comp_unit /
process_full_type_unit, just like std::vector in the patch above, but could contain many fields.

I found something potentially problematic though (applies to both your and my patch).  When we process
the delayed_method_info objects in compute_delayed_physnames, we call:

  dwarf2_physname (mi.name, mi.die, cu);

mi.die could be a die coming from X's CU (to keep the example from my previous message), but the
cu in the call above is A's CU (the CU we are processing).  I am pretty sure that this function
(and what it calls) expect the passed DIE to come from the passed CU.  If they don't match, I guess
we could have some bad surprises.

Simon

  reply	other threads:[~2019-10-17  5:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  0:19 [PATCH 0/2] Fix BZ 25065 (LTO related GDB segfault) Kevin Buettner
2019-10-14  0:19 ` [PATCH 2/2] Test case for BZ 25065 Kevin Buettner
2019-12-08 10:29   ` [committed] Fix inter-CU references using intra-CU form in imported-unit Tom de Vries
2019-10-14  0:19 ` [PATCH 1/2] Fix BZ 25065 - Ensure that physnames are computed for inherited DIEs Kevin Buettner
2019-10-14  3:02   ` Simon Marchi
2019-10-15 16:27     ` Kevin Buettner
2019-10-17  3:54       ` Simon Marchi
2019-10-17  5:30         ` Simon Marchi [this message]
2019-10-18  1:08           ` Kevin Buettner
2019-10-18 15:07             ` Simon Marchi
2019-10-21 20:05               ` Keith Seitz
2019-10-22 22:23               ` Kevin Buettner
2019-11-04 20:42                 ` Kevin Buettner
2019-11-04 20:49                 ` Simon Marchi
2019-11-27 20:17                   ` Kevin Buettner

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=dd3ec9ad-f017-b337-6a00-8379a5f4c79a@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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).