[committed] Emit ISA-encoded dwarf2 line info for MIPS16

Richard Sandiford rsandifo@redhat.com
Thu May 20 10:22:00 GMT 2004


This patch changes the MIPS16 dwarf2 line information so that it uses
ISA-encoded addresses rather than physical addresses.  This is what
GDB expects to see, and is more consistent with things like unwind
information, which already uses ISA-encoded addressses.

We've been using this internally for a while and it seems to have
stood the test of time.  Tested on a variety of binutils targets.
Approved by Eric & applied.

Richard


	* config/tc-mips.c (append_insn): Use ISA-encoded addresses in MIPS16
	dwarf tables.

Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.264
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.264 tc-mips.c
--- gas/config/tc-mips.c	7 May 2004 16:39:26 -0000	1.264
+++ gas/config/tc-mips.c	20 May 2004 10:10:23 -0000
@@ -2242,7 +2242,12 @@ #define emit_nop()					\
       md_number_to_chars (f, ip->insn_opcode >> 16, 2);
       md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2);
 #ifdef OBJ_ELF
-      dwarf2_emit_insn (4);
+      /* The value passed to dwarf2_emit_insn is the distance between
+	 the end of the current instruction and the address that should
+	 be recorded in the debug tables.  Since we want to use ISA-encoded
+	 addresses in MIPS16 debug info, the value is one byte less than
+	 the real instruction length.  */
+      dwarf2_emit_insn (3);
 #endif
     }
   else
@@ -2254,7 +2259,7 @@ #define emit_nop()					\
 	}
       md_number_to_chars (f, ip->insn_opcode, 2);
 #ifdef OBJ_ELF
-      dwarf2_emit_insn (ip->use_extend ? 4 : 2);
+      dwarf2_emit_insn (ip->use_extend ? 3 : 1);
 #endif
     }
 



More information about the Binutils mailing list