This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa/dwarf] Handle debug_line extended ops correctly
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Cc: Michael Coulter <coulter at cup dot hp dot com>, Jim Blandy <jimb at redhat dot com>,Elena Zannoni <ezannoni at redhat dot com>
- Date: Wed, 16 Jun 2004 11:44:03 -0400
- Subject: [rfa/dwarf] Handle debug_line extended ops correctly
This has been hanging around in my tree for a while. The HP-UX ia64
compiler generates things like this in .debug_line:
Extended opcode 32: UNKNOWN: length 51
Extended opcode 32: UNKNOWN: length 146
146 is different as a byte and as a uleb128, so we get confused. Of course,
we're going to bail out shortly anyway because we don't accept unknown
extended ops (probably for the best); but we might as well parse the length
right.
OK?
--
Daniel Jacobowitz
2004-06-16 Daniel Jacobowitz <dan@debian.org>
PR gdb/1658
* dwarf2read.c (dwarf_decode_lines): Read the length of the extended
operation as a uleb128. Found by Michael Coulter.
Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.153
diff -u -p -r1.153 dwarf2read.c
--- gdb/dwarf2read.c 15 Jun 2004 01:04:19 -0000 1.153
+++ gdb/dwarf2read.c 16 Jun 2004 15:38:49 -0000
@@ -5986,7 +5986,8 @@ dwarf_decode_lines (struct line_header *
else switch (op_code)
{
case DW_LNS_extended_op:
- line_ptr += 1; /* ignore length */
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
extended_op = read_1_byte (abfd, line_ptr);
line_ptr += 1;
switch (extended_op)