diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 19:46:05 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 19:46:05 +0000 |
commit | 2bda9cc5eef486f0d39234cbb9b5be26c9ccaa5b (patch) | |
tree | 1b61724e1806a728512e10397555cf7c0038936f /gdb/dwarf2loc.c | |
parent | a471c5941e127823b95893176c7c9301c4b4cb32 (diff) | |
download | gdb-2bda9cc5eef486f0d39234cbb9b5be26c9ccaa5b.zip gdb-2bda9cc5eef486f0d39234cbb9b5be26c9ccaa5b.tar.gz gdb-2bda9cc5eef486f0d39234cbb9b5be26c9ccaa5b.tar.bz2 |
gdb/
Entry values NEWS entries, DWARF disassembly support.
* NEWS: New entry values entry.
(set print entry-values, show print entry-values)
(set debug entry-values, show debug entry-values): New entries.
* dwarf2loc.c (disassemble_dwarf_expression): New parameters start and
indent. Remove variable start. Move header printing out. Respect
INDENT. Support DW_OP_GNU_entry_value.
(locexpr_describe_location_1): Move the header printing here, extend
the disassemble_dwarf_expression passed parameters.
gdb/testsuite/
* gdb.arch/amd64-entry-value.s: New file.
* gdb.mi/mi2-amd64-entry-value.s: New file.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 0e1179c..52fda27 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -3258,15 +3258,11 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream, static const gdb_byte * disassemble_dwarf_expression (struct ui_file *stream, struct gdbarch *arch, unsigned int addr_size, - int offset_size, + int offset_size, const gdb_byte *start, const gdb_byte *data, const gdb_byte *end, - int all, + int indent, int all, struct dwarf2_per_cu_data *per_cu) { - const gdb_byte *start = data; - - fprintf_filtered (stream, _("a complex DWARF expression:\n")); - while (data < end && (all || (data[0] != DW_OP_piece && data[0] != DW_OP_bit_piece))) @@ -3281,7 +3277,8 @@ disassemble_dwarf_expression (struct ui_file *stream, if (!name) error (_("Unrecognized DWARF opcode 0x%02x at %ld"), op, (long) (data - 1 - start)); - fprintf_filtered (stream, " % 4ld: %s", (long) (data - 1 - start), name); + fprintf_filtered (stream, " %*ld: %s", indent + 4, + (long) (data - 1 - start), name); switch (op) { @@ -3579,6 +3576,15 @@ disassemble_dwarf_expression (struct ui_file *stream, } } break; + + case DW_OP_GNU_entry_value: + data = read_uleb128 (data, end, &ul); + fputc_filtered ('\n', stream); + disassemble_dwarf_expression (stream, arch, addr_size, offset_size, + start, data, data + ul, indent + 2, + all, per_cu); + data += ul; + continue; } fprintf_filtered (stream, "\n"); @@ -3623,11 +3629,15 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr, disassemble = 0; } if (disassemble) - data = disassemble_dwarf_expression (stream, - get_objfile_arch (objfile), - addr_size, offset_size, data, end, - dwarf2_always_disassemble, - per_cu); + { + fprintf_filtered (stream, _("a complex DWARF expression:\n")); + data = disassemble_dwarf_expression (stream, + get_objfile_arch (objfile), + addr_size, offset_size, data, + data, end, 0, + dwarf2_always_disassemble, + per_cu); + } if (data < end) { |