From 1a509dcc12769a52569c270c67356cc81739c28c Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Tue, 13 Nov 2001 20:13:30 +0000 Subject: Index: bfd/ChangeLog 2001-11-11 Geoffrey Keating * dwarf2.c (decode_line_info): Properly deal with unknown standard opcodes. Index: binutils/ChangeLog 2001-11-11 Geoffrey Keating * 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 * dwarf2.h (dwarf_line_number_ops): Add DWARF 3 opcodes. --- bfd/dwarf2.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'bfd/dwarf2.c') 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; + } + } } } } -- cgit v1.1