diff options
author | Tom Tromey <tromey@adacore.com> | 2020-04-03 09:11:55 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-03 09:15:41 -0600 |
commit | d9e49b61691f384447242f54c996fe80ef9bf184 (patch) | |
tree | fb153a956ccb31fea078e280d952360fdd73ae38 /gdb/dwarf2 | |
parent | 492c3f03c701c911c9873eb4dd757fdb5fb13fd8 (diff) | |
download | gdb-d9e49b61691f384447242f54c996fe80ef9bf184.zip gdb-d9e49b61691f384447242f54c996fe80ef9bf184.tar.gz gdb-d9e49b61691f384447242f54c996fe80ef9bf184.tar.bz2 |
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.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/loc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 6440335..fc54e16 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; |