diff options
author | Geoffrey Keating <geoffk@geoffk.org> | 2001-11-12 20:36:55 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@geoffk.org> | 2001-11-12 20:36:55 +0000 |
commit | 86e7478103bf01ac25121f0e651b47dafe523624 (patch) | |
tree | 7774bc297a066dce81e6695b5407f9de01198b31 /gdb/dwarf2read.c | |
parent | 1e5c2044bf341240f5cc915f2f739ec2ddbafe02 (diff) | |
download | gdb-86e7478103bf01ac25121f0e651b47dafe523624.tar.gz |
* dwarf2read.c (dwarf_decode_lines): Properly deal with
unknown standard opcodes.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 16a3e23080e..2ecfe8a7a1c 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3963,7 +3963,18 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd, { 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 */ + record_line (current_subfile, line, address); + basic_block = 1; + } + else switch (op_code) { case DW_LNS_extended_op: line_ptr += 1; /* ignore length */ @@ -4061,14 +4072,15 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd, 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 */ - record_line (current_subfile, line, address); - basic_block = 1; + 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; + } + } } } } |