public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Cc: Mark Wielaard <mark@gcc.gnu.org>
Subject: [committed] Fix error: Unknown DWARF DW_FORM_ref_sig8
Date: Fri, 2 Oct 2020 19:05:22 +0200	[thread overview]
Message-ID: <20201002170521.GA31168@delia> (raw)

Hi,

When running the gdb testsuite using target board cc-with-dwz, I ran into:
...
dwz: cpexprs-debug-types: Unknown DWARF DW_FORM_ref_sig8
dwz: cpexprs-debug-types: Couldn't read abbrev at offset 0x64
...

I traced this back to some code in read_abbrev, which until recent was:
...
         if (form == 2
             || (form > DW_FORM_flag_present && form != DW_FORM_ref_sig8))
           {
             error (0, 0, "%s: Unknown DWARF %s",
                    dso->filename, get_DW_FORM_str (form));
...
but now has been extended to:
...
         if (form == 2
             || (form > DW_FORM_flag_present
                 && (form != DW_FORM_ref_sig8
                     || form != DW_FORM_data16
                     || form != DW_FORM_line_strp)))
...

Before, form == DW_FORM_ref_sig8 didn't trigger an error because
form != DW_FORM_ref_sig8 evaluated to false.

Now, form == DW_FORM_ref_sig8 does trigger an error because
form != DW_FORM_data16 evaluates to true.

Fix by using this instead:
...
                 && !(form == DW_FORM_ref_sig8
                      || form == DW_FORM_data16
                      || form == DW_FORM_line_strp)))
...

Tested dwz testsuite, and cpexprs-debug-types.

Committed to trunk.

Thanks,
- Tom

Fix error: Unknown DWARF DW_FORM_ref_sig8

2020-10-02  Tom de Vries  <tdevries@suse.de>

	* dwz.c (read_abbrev): Fix "Unknown DWARF DW_FORM_ref_sig8" error.

---
 dwz.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dwz.c b/dwz.c
index eb52079..487fbc6 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1261,9 +1261,9 @@ read_abbrev (DSO *dso, unsigned char *ptr)
 	  form = read_uleb128 (p);
 	  if (form == 2
 	      || (form > DW_FORM_flag_present
-		  && (form != DW_FORM_ref_sig8
-		      || form != DW_FORM_data16
-		      || form != DW_FORM_line_strp)))
+		  && !(form == DW_FORM_ref_sig8
+		       || form == DW_FORM_data16
+		       || form == DW_FORM_line_strp)))
 	    {
 	      error (0, 0, "%s: Unknown DWARF %s",
 		     dso->filename, get_DW_FORM_str (form));

             reply	other threads:[~2020-10-02 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 17:05 Tom de Vries [this message]
2020-10-02 17:10 ` Jakub Jelinek
2020-10-02 17:43   ` 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=20201002170521.GA31168@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@gcc.gnu.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).