public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Mark Wielaard <mark@klomp.org>, dwz@sourceware.org
Subject: Re: [PATCH] Remove left over "negate" adjustment in compute_abbrevs.
Date: Mon, 15 Feb 2021 09:32:40 +0100	[thread overview]
Message-ID: <32aa3bcc-a5ec-35ac-931a-1c288a636641@suse.de> (raw)
In-Reply-To: <20210214153443.19697-1-mark@klomp.org>

On 2/14/21 4:34 PM, Mark Wielaard wrote:
> Before commit 47af8da7c "Assorted DW_FORM_implicit_const fixes" there
> was a hack to track whether decl/call_file line numbers had been
> translated already. This worked by negating the value once it was

I'd add "translated" here, reads easier.

> and
> not translating again when the value was negative. Then in
> compute_abbrevs all negated values we made positive again. Most of

we -> were

> this hack was removed in the above commit. Except for making all
> negated values positive again in compute_abbrevs. Remove it there too.
> No decl/call_file line number tables can ever be negative.
> 

LGTM.

Thanks,
- Tom

>    * dwz.c (compute_abbrevs): Remove negate adjustment for
>    DW_AT_decl_file and DW_AT_call_file attribute DW_FORM_implicit_const
>    values.
> ---
>  dwz.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/dwz.c b/dwz.c
> index 992da77..0664052 100644
> --- a/dwz.c
> +++ b/dwz.c
> @@ -11622,20 +11622,7 @@ compute_abbrevs (DSO *dso)
>  	      abbrev_size += size_of_uleb128 (arr[i]->attr[j].attr);
>  	      abbrev_size += size_of_uleb128 (arr[i]->attr[j].form);
>  	      if (arr[i]->attr[j].form == DW_FORM_implicit_const)
> -		{
> -		  /* If this is a shared abbrev for a file reference
> -		     attribute, update to the new file number (in the
> -		     mulifile .debug_line).  Note that this might
> -		     change the abbrev size...  */
> -		  if (unlikely (wr_multifile || op_multifile)
> -		      && (arr[i]->attr[j].attr == DW_AT_decl_file
> -			  || arr[i]->attr[j].attr == DW_AT_call_file))
> -		    {
> -		      if (arr[i]->values[j] < 0)
> -			arr[i]->values[j] = -arr[i]->values[j];
> -		    }
> -		  abbrev_size += size_of_sleb128 (arr[i]->values[j]);
> -		}
> +		abbrev_size += size_of_sleb128 (arr[i]->values[j]);
>  	    }
>  	  abbrev_size += 2;
>  	}
> 

  reply	other threads:[~2021-02-15  8:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 15:34 Mark Wielaard
2021-02-15  8:32 ` Tom de Vries [this message]
2021-02-15  9:21   ` Mark Wielaard

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=32aa3bcc-a5ec-35ac-931a-1c288a636641@suse.de \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=mark@klomp.org \
    /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).