diff options
author | Geoffrey Keating <geoffk@geoffk.org> | 2001-11-13 20:13:30 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@geoffk.org> | 2001-11-13 20:13:30 +0000 |
commit | 1a509dcc12769a52569c270c67356cc81739c28c (patch) | |
tree | af34ff69925b2a11d721b111dddd4f32de0f6e7e /bfd | |
parent | 8b982acfc63906d5207737a6e2072ed70884fe0e (diff) | |
download | gdb-1a509dcc12769a52569c270c67356cc81739c28c.zip gdb-1a509dcc12769a52569c270c67356cc81739c28c.tar.gz gdb-1a509dcc12769a52569c270c67356cc81739c28c.tar.bz2 |
Index: bfd/ChangeLog
2001-11-11 Geoffrey Keating <geoffk@redhat.com>
* dwarf2.c (decode_line_info): Properly deal with unknown standard
opcodes.
Index: binutils/ChangeLog
2001-11-11 Geoffrey Keating <geoffk@redhat.com>
* readelf.c (display_debug_lines): Deal with unknown standard
opcodes. Handle DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin,
DW_LNS_set_isa.
Index: include/elf/ChangeLog
2001-11-11 Geoffrey Keating <geoffk@redhat.com>
* dwarf2.h (dwarf_line_number_ops): Add DWARF 3 opcodes.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/dwarf2.c | 39 |
2 files changed, 30 insertions, 14 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e37b504..164dd2e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2001-11-13 Geoffrey Keating <geoffk@redhat.com> + + * dwarf2.c (decode_line_info): Properly deal with unknown standard + opcodes. + 2001-11-13 John Marshall <jmarshall@acm.org> Alan Modra <amodra@bigpond.net.au> diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 6edbc0b..209cd8f 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -979,7 +979,22 @@ decode_line_info (unit, stash) op_code = read_1_byte (abfd, line_ptr); line_ptr += 1; - switch (op_code) + if (op_code >= lh.opcode_base) + { /* Special operand. */ + adj_opcode = op_code - lh.opcode_base; + address += (adj_opcode / lh.line_range) + * lh.minimum_instruction_length; + line += lh.line_base + (adj_opcode % lh.line_range); + /* Append row to matrix using current values. */ + add_line_info (table, address, filename, line, column, 0); + basic_block = 1; + if (need_low_pc) + { + need_low_pc = 0; + low_pc = address; + } + } + else switch (op_code) { case DW_LNS_extended_op: line_ptr += 1; /* Ignore length. */ @@ -1079,19 +1094,15 @@ decode_line_info (unit, stash) address += read_2_bytes (abfd, line_ptr); line_ptr += 2; break; - default: /* Special operand. */ - adj_opcode = op_code - lh.opcode_base; - address += (adj_opcode / lh.line_range) - * lh.minimum_instruction_length; - line += lh.line_base + (adj_opcode % lh.line_range); - /* Append row to matrix using current values. */ - add_line_info (table, address, filename, line, column, 0); - basic_block = 1; - if (need_low_pc) - { - need_low_pc = 0; - low_pc = address; - } + default: + { /* Unknown standard opcode, ignore it. */ + int i; + for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++) + { + (void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read); + line_ptr += bytes_read; + } + } } } } |