From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/dwarf: fix reading subprogram with DW_AT_specification (PR gdb/26693)
Date: Wed, 21 Oct 2020 22:37:07 -0400 [thread overview]
Message-ID: <ed370dc5-8afe-7403-7253-2957bbd63c40@polymtl.ca> (raw)
In-Reply-To: <878sbzgvk0.fsf@tromey.com>
On 2020-10-21 4:42 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> 0x00000014: DW_TAG_subprogram
> Simon> DW_AT_name [DW_FORM_string] ("apply")
>
> Simon> 0x0000001b: DW_TAG_subprogram
> Simon> DW_AT_specification [DW_FORM_ref4] (0x00000014 "apply")
>
> gdb currently goes through a lot of work to support DWARF like this, but
> I wish it didn't have to. It complicates the DWARF reader -- but IIRC
> both gcc and clang just emit specializations with names like
> "apply<int>". So, I wonder if we could drop support for this at some
> point.
The object that contained this kind of DWARF, that made GDB crash, was
compiled with ICC. So unless we decide to drop support for ICC, I don't
think we can get rid of it any time soon.
> Simon> Since the caller of load_full_comp_unit knows about the existing
> Simon> dwarf2_cu object for the CU we are reading (the one load_full_comp_unit
> Simon> is expected to find), we can simply make it pass it down, instead of
> Simon> having load_full_comp_unit look up the per-objfile map.
>
> Sounds reasonable.
>
> Simon> @@ -9231,12 +9233,12 @@ die_eq (const void *item_lhs, const void *item_rhs)
> Simon> static void
> Simon> load_full_comp_unit (dwarf2_per_cu_data *this_cu,
> Simon> dwarf2_per_objfile *per_objfile,
> Simon> + dwarf2_cu *existing_cu,
>
> I think a comment explaining why this is needed would be really helpful.
>
> The patch looks good to me. Thank you very much for the detailed
> explanation.
I would write this, does that sound good?
/* Load the DIEs associated with PER_CU into memory.
In some cases, the caller, while reading partial symbols, will need to load
the full symbols for the CU for some reason. It will already have a
dwarf2_cu object for THIS_CU and pass it as EXISTING_CU, so it can be re-used
rather than creating a new one. */
Thanks for the review.
Simon
next prev parent reply other threads:[~2020-10-22 2:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 14:18 [PATCH] " Simon Marchi via Gdb-patches
2020-10-20 15:13 ` Simon Marchi via Gdb-patches
2020-10-20 15:55 ` Strasuns, Mihails via Gdb-patches
2020-10-20 16:29 ` Tom de Vries
2020-10-20 16:48 ` Simon Marchi via Gdb-patches
2020-10-20 16:50 ` [PATCH v2] " Simon Marchi via Gdb-patches
2020-10-21 20:42 ` Tom Tromey
2020-10-22 2:37 ` Simon Marchi via Gdb-patches [this message]
2020-10-22 14:18 ` Tom Tromey
2020-10-22 14:51 ` Simon Marchi via Gdb-patches
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=ed370dc5-8afe-7403-7253-2957bbd63c40@polymtl.ca \
--to=gdb-patches@sourceware.org \
--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