aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>2001-11-12 20:36:55 +0000
committerGeoffrey Keating <geoffk@geoffk.org>2001-11-12 20:36:55 +0000
commit9aa1fe7eee9169fed74ed3b8b5810be12fb53ca0 (patch)
treec23e2f438da357ff69f6a23668b80fc1ea8447b2
parent1902c51fa6c7592a74d1006067ab61aabef4ac33 (diff)
downloadgdb-9aa1fe7eee9169fed74ed3b8b5810be12fb53ca0.zip
gdb-9aa1fe7eee9169fed74ed3b8b5810be12fb53ca0.tar.gz
gdb-9aa1fe7eee9169fed74ed3b8b5810be12fb53ca0.tar.bz2
* dwarf2read.c (dwarf_decode_lines): Properly deal with
unknown standard opcodes.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2read.c30
2 files changed, 26 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4d1d19a..f2ddf39 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-11 Geoffrey Keating <geoffk@redhat.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Properly deal with
+ unknown standard opcodes.
+
2001-11-11 Andrew Cagney <ac131313@redhat.com>
* README (alpha-dec-osf5.1): Mention -DUSE_LDR_ROUTINES.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 16a3e23..2ecfe8a 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;
+ }
+ }
}
}
}