public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: dwz@sourceware.org
Subject: Re: [PATCH] Support updating DWARF5 .debug_loclists.
Date: Tue, 29 Sep 2020 19:59:28 +0200	[thread overview]
Message-ID: <0a54a00b4b663a61dda849c0aaeee2976579875f.camel@klomp.org> (raw)
In-Reply-To: <20200929084223.GX2176@tucnak>

Hi Jakub,

On Tue, 2020-09-29 at 10:42 +0200, Jakub Jelinek wrote:
> On Mon, Sep 28, 2020 at 10:07:59AM +0200, Mark Wielaard wrote:
> >    ptr += offset;
> >    while (ptr < endsec)
> >      {
> > -      low = read_size (ptr, ptr_size);
> > -      high = read_size (ptr + ptr_size, ptr_size);
> > -      ptr += 2 * ptr_size;
> > -      if (low == 0 && high == 0)
> > -	break;
> > +      if (cu->cu_version < 5)
> 
> I wonder if it wouldn't be clearer to use sec == DEBUG_LOC
> in this spot (i.e. leave the decision based on cu_version just to the
> start of the function).

Yes, it would be clearer. Changed.

> > +	    case DW_LLE_start_length:
> > +	      ptr += ptr_size;
> > +	      skip_leb128 (ptr);
> > +	      len = read_uleb128 (ptr);
> > +	      break;
> 
> Wonder if we shouldn't handle case DW_LLE_GNU_view_part here, but perhaps
> only for cu->cu_version == 5 because it isn't in a separate vendor code
> space and thus in DWARF 6 it could mean something different.

Yes, it would. gcc doesn't emit it by default at the moment. But
handling it is easy:

            case DW_LLE_GNU_view_pair:                                          
              if (cu->cu_version != 5)                                          
                error (0, 0,                                                    
                       "%s: DW_LLE_GNU_view_pair used with DWARF version %u\n", 
                       dso->filename, cu->cu_version);                          
              skip_leb128 (ptr);                                                
              skip_leb128 (ptr);                                                
              continue;

It will warn, but still try to handle it as is.
We probably never hit
this because dwz doesn't actually accept
DWARFv6 CUs, because they don't
exist yet :)

> Otherwise LGTM.

Thanks. Pushed with those changes. Tested against a
gcc -gvariable-location-views=incompat5 build.

BTW. I fixed binutils readelf so that it now also correctly shows
.debug_loclists:
https://sourceware.org/pipermail/binutils/2020-September/113510.html

Cheers,

Mark

      reply	other threads:[~2020-09-29 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28  8:07 Mark Wielaard
2020-09-29  8:42 ` Jakub Jelinek
2020-09-29 17:59   ` Mark Wielaard [this message]

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=0a54a00b4b663a61dda849c0aaeee2976579875f.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=dwz@sourceware.org \
    --cc=jakub@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).