aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2005-02-22 12:32:26 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2005-02-22 12:32:26 +0000
commit58e2ea4d1caa51d171a9a8fb8649a6cda59ad28e (patch)
tree41dc5ef9d0a3ed752a9c827779ae5b40b27e8a12 /gas/config/tc-mips.c
parente4d180c27bb1031f96195ef31213f3a5701879a9 (diff)
downloadgdb-58e2ea4d1caa51d171a9a8fb8649a6cda59ad28e.zip
gdb-58e2ea4d1caa51d171a9a8fb8649a6cda59ad28e.tar.gz
gdb-58e2ea4d1caa51d171a9a8fb8649a6cda59ad28e.tar.bz2
gas/:
* config/tc-mips.c (append_insn): Call dwarf2_emit_insn() before emitting insn. gas/testsuite/: * gas/mips/mips16-dwarf2.d: New test to check DWARF2 line information for MIPS16. * gas/mips/mips16-dwarf2.s: Source for the new test. * gas/mips/mips.exp: Run the new test.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index c2129b3..58536ad 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -2009,6 +2009,15 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
}
}
+#ifdef OBJ_ELF
+ /* The value passed to dwarf2_emit_insn is the distance between
+ the beginning of the current instruction and the address that
+ should be recorded in the debug tables. For MIPS16 debug info
+ we want to use ISA-encoded addresses, so we pass -1 for an
+ address higher by one than the current. */
+ dwarf2_emit_insn (mips_opts.mips16 ? -1 : 0);
+#endif
+
/* Record the frag type before frag_var. */
if (prev_insn_frag)
prev_insn_frag_type = prev_insn_frag->fr_type;
@@ -2243,24 +2252,11 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
}
if (! mips_opts.mips16)
- {
- md_number_to_chars (f, ip->insn_opcode, 4);
-#ifdef OBJ_ELF
- dwarf2_emit_insn (4);
-#endif
- }
+ md_number_to_chars (f, ip->insn_opcode, 4);
else if (*reloc_type == BFD_RELOC_MIPS16_JMP)
{
md_number_to_chars (f, ip->insn_opcode >> 16, 2);
md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2);
-#ifdef OBJ_ELF
- /* 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
{
@@ -2270,9 +2266,6 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
f += 2;
}
md_number_to_chars (f, ip->insn_opcode, 2);
-#ifdef OBJ_ELF
- dwarf2_emit_insn (ip->use_extend ? 3 : 1);
-#endif
}
/* Update the register mask information. */