From: Tom Tromey Date: Fri, 3 Apr 2020 15:11:55 +0000 (-0600) Subject: Fix DWARF disassembly of DW_OP_const_type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9e49b61691f384447242f54c996fe80ef9bf184;p=binutils-gdb.git 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 * dwarf2/loc.c (disassemble_dwarf_expression) : Read constant block. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e93725129d5..86d949b212c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-04-03 Tom Tromey + + * dwarf2/loc.c (disassemble_dwarf_expression) : + Read constant block. + 2020-04-02 Simon Marchi * gdb_bfd.h: Include gdbsupport/byte-vector.h. diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 6440335ccbd..fc54e16ffdd 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;