From: Simon Marchi <simark@simark.ca>
To: Caroline Tice <cmtice@google.com>
Cc: Eric Christopher <echristo@google.com>,
Tom Tromey <tom@tromey.com>,
Caroline Tice via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH V5] Fix issues with reading rnglists, especially from dwo files, for DWARF v5
Date: Tue, 14 Jul 2020 22:04:08 -0400 [thread overview]
Message-ID: <4da310be-fa9f-9f21-8988-81af58ec73e3@simark.ca> (raw)
In-Reply-To: <CABtf2+Tm6qc-0boFbASe1Q24zFWwonrDRVAv3xxnOOo9ioRxVg@mail.gmail.com>
On 2020-07-14 11:47 a.m., Caroline Tice wrote:
> "This time for sure!" -- Bullwinkle Moose
>
> I think I've got all of your requested changes in now, and I've
> attached the updated patch. About what you said at the very end of
> your last message:
>
>> I thought that somehow, when reading a CU that uses a DWO, we were creating
>> a "logical" DIE tree by combining the DW_TAG_skeleton_unit DIE and the
>> children of the DWO's DW_TAG_compile_unit DIE, and while doing this,
>> overwriting the DW_TAG_skeleton_unit's DIE to use the DW_TAG_compile_unit
>> tag instead. Therefore making it appear to the rest of the DWARF reader
>> as if it was a "standard" DW_TAG_compile_unit DIE. But no, maybe I just dreamed
>> all of this, or I can't find it anymore.
>>
>
> Actually your first thought was absolutely correct. This is done in
> cutu_reader::cutu_reader. In my patched
> read.c this is at line 7244:
>
> comp_unit_die = dwo_comp_unit_die;
Ah ok, we just the full tree from the dwo. And in read_cutu_die_from_dwo we copy
over some useful attributes from the skeleton to the dwo's root DIE, like the ranges.
Looks like I need to read and understand something a few times before it stays :).
>> In fact, the reason the code was checking for DW_TAG_compile_unit must be that
>> in the GCC/pre-standard version, the skeleton DIE in the executable is a
>> DW_TAG_compile_unit. With DWARF5, we'll see DW_TAG_skeleton_unit here.
>>
>> So I believe we should use
>>
>> (tag != DW_TAG_compile_unit && tag != DW_TAG_skeleton_unit)
>>
>> to cover both versions, GCC pre-standard and DWARF 5. Does that make sense?
>
> I agree that we need to check both cases in cu_debug_rnglists_section,
> because sometimes it gets called before the line above in cutu_reader,
> and sometimes it gets called after (now that I'm also calling it in
> dwarf2_rnglists_process).
Ok.
>> Wherever we use the logic:
>>
>> int need_ranges_base = (die->tag != DW_TAG_compile_unit
>> && attr->form != DW_FORM_rnglistx);
>>
>> we should maybe check for DW_TAG_skeleton_unit as well?"
>
> I don't think there's any point in checking for DW_TAG_skeleton_unit
> in the need_ranges_base checks, because I believe that all of those
> checks are called after the call to cutu_reader, so we never have a
> DW_TAG_skeleton_unit by the time we get to those checks.
Makes sense, I think.
I don't think I have any more comments. Tom, are you ok with this?
Simon
next prev parent reply other threads:[~2020-07-15 2:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 17:16 [PATCH] " Caroline Tice
2020-06-01 20:33 ` Tom Tromey
2020-06-02 17:04 ` Caroline Tice
2020-06-03 14:49 ` Tom Tromey
2020-06-04 21:39 ` Caroline Tice
2020-06-09 23:32 ` Caroline Tice
2020-06-16 15:37 ` Caroline Tice
2020-06-18 20:27 ` Tom Tromey
2020-06-23 19:04 ` Caroline Tice
2020-07-01 0:09 ` Caroline Tice
2020-07-01 0:34 ` Simon Marchi
2020-07-01 0:36 ` Simon Marchi
2020-07-01 19:57 ` Caroline Tice
2020-07-02 5:41 ` Simon Marchi
2020-07-03 22:47 ` [PATCH V3] " Caroline Tice
2020-07-04 5:11 ` Simon Marchi
2020-07-09 15:48 ` [PATCH V4] " Caroline Tice
2020-07-11 17:54 ` Simon Marchi
2020-07-14 15:47 ` [PATCH V5] " Caroline Tice
2020-07-15 2:04 ` Simon Marchi [this message]
2020-07-15 3:15 ` Simon Marchi
2020-07-15 16:57 ` Caroline Tice
2020-07-15 17:04 ` H.J. Lu
2020-07-15 22:35 ` Caroline Tice
2020-07-16 2:34 ` Simon Marchi
2020-07-16 4:46 ` Caroline Tice
2020-07-16 15:41 ` Simon Marchi
2020-07-16 15:46 ` Caroline Tice
2020-07-16 16:09 ` 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=4da310be-fa9f-9f21-8988-81af58ec73e3@simark.ca \
--to=simark@simark.ca \
--cc=cmtice@google.com \
--cc=echristo@google.com \
--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).