This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix buglet in DWARF disassembly
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 13 May 2011 12:41:28 -0600
- Subject: FYI: fix buglet in DWARF disassembly
I'm checking this in on the trunk.
The DWARF disassembler in GDB had a buglet where instruction offsets
would be off by 1. This caused me some confusion when trying to fix a
bug in DWARF expression evaluation.
Fixed as appended.
Built and regtested on the buildbot.
Tom
2011-05-13 Tom Tromey <tromey@redhat.com>
* dwarf2loc.c (disassemble_dwarf_expression): Fix instruction
offset display.
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.117
diff -u -r1.117 dwarf2loc.c
--- dwarf2loc.c 13 May 2011 15:44:49 -0000 1.117
+++ dwarf2loc.c 13 May 2011 18:40:26 -0000
@@ -2364,8 +2364,8 @@
if (!name)
error (_("Unrecognized DWARF opcode 0x%02x at %ld"),
- op, (long) (data - start));
- fprintf_filtered (stream, " % 4ld: %s", (long) (data - start), name);
+ op, (long) (data - 1 - start));
+ fprintf_filtered (stream, " % 4ld: %s", (long) (data - 1 - start), name);
switch (op)
{