public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Fix DWARF disassembly of DW_OP_const_type
Date: Tue, 21 Apr 2020 11:38:19 -0400	[thread overview]
Message-ID: <d9e49b61691f384447242f54c996fe80ef9bf184@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT d9e49b61691f384447242f54c996fe80ef9bf184 ***

commit d9e49b61691f384447242f54c996fe80ef9bf184
Author:     Tom Tromey <tromey@adacore.com>
AuthorDate: Fri Apr 3 09:11:55 2020 -0600
Commit:     Tom Tromey <tromey@adacore.com>
CommitDate: Fri Apr 3 09:15:41 2020 -0600

    Fix DWARF disassembly of DW_OP_const_type
    
    While debugging another issue, I noticed that disassembling a DWARF
    expression using DW_OP_const_type did not work.
    disassemble_dwarf_expression was not properly decoding this operation.
    
    This patch fixes the problem.  Tested by re-debugging gdb.
    
    I didn't write a test case because that seemed like overkill for
    what's essentially a maintainer's helper.
    
    The expression evaluator does decode this properly, so no other change
    was needed.
    
    gdb/ChangeLog
    2020-04-03  Tom Tromey  <tromey@adacore.com>
    
            * dwarf2/loc.c (disassemble_dwarf_expression) <DW_OP_const_type>:
            Read constant block.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e93725129d..86d949b212 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-03  Tom Tromey  <tromey@adacore.com>
+
+	* dwarf2/loc.c (disassemble_dwarf_expression) <DW_OP_const_type>:
+	Read constant block.
+
 2020-04-02  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* gdb_bfd.h: Include gdbsupport/byte-vector.h.
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 6440335ccb..fc54e16ffd 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -4082,6 +4082,12 @@ disassemble_dwarf_expression (struct ui_file *stream,
 	    type_print (type, "", stream, -1);
 	    fprintf_filtered (stream, " [0x%s]>",
 			      phex_nz (to_underlying (type_die), 0));
+
+	    int n = *data++;
+	    fprintf_filtered (stream, " %d byte block:", n);
+	    for (int i = 0; i < n; ++i)
+	      fprintf_filtered (stream, " %02x", data[i]);
+	    data += n;
 	  }
 	  break;
 


             reply	other threads:[~2020-04-21 15:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 15:38 gdb-buildbot [this message]
2020-04-21 15:38 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-04-21 15:50 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-04-21 16:26 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-04-21 16:41 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-04-21 17:26 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-04-21 17:41 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-04-22 16:03 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-04-23 10:37 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-04-26  4:48 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot

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=d9e49b61691f384447242f54c996fe80ef9bf184@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.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).