This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: .file/.loc for m68k targets
Nick Clifton <nickc@redhat.com> writes:
|> Hi Andreas,
|>
|> : This patch add support for dwarf2 .file and .loc in the m68k assembler.
|> :
|> : 2001-07-17 Andreas Schwab <schwab@suse.de>
|> :
|> : * config/tc-m68k.c (md_pseudo_table): Add .file and .loc.
|> : * config/tc-m68k.h (DWARF2_LINE_MIN_INSN_LENGTH): Define.
|>
|> There are a couple of problems with this patch.
|>
|> You only want to use the dwarf2 directives if BFD_ASSEMBLER is
|> defined, or, more probably, if OBJ_ELF is defined.
tc-i386.c is using them unconditionally, too.
|> Secondly, you presumably need to add a call to dwarf2_emit_insn()
|> somewhere so that the line table information is actually constructed.
Ok, here is a new patch, tested together with gcc 2.95.4.
2001-07-17 Andreas Schwab <schwab@suse.de>
* config/tc-m68k.c (md_pseudo_table) [OBJ_ELF]: Add .file and
.loc.
(md_assemble) [OBJ_ELF]: Call dwarf2_emit_insn before emitting
insn.
* config/tc-m68k.h (DWARF2_LINE_MIN_INSN_LENGTH): Define.
--- config/tc-m68k.c.~1.27.~ Mon Jul 16 10:47:35 2001
+++ config/tc-m68k.c Tue Jul 17 16:39:32 2001
@@ -24,6 +24,7 @@
#include "as.h"
#include "obstack.h"
#include "subsegs.h"
+#include "dwarf2dbg.h"
#include "opcode/m68k.h"
#include "m68k-parse.h"
@@ -558,6 +559,12 @@
{"extend", float_cons, 'x'},
{"ldouble", float_cons, 'x'},
+#ifdef OBJ_ELF
+ /* Dwarf2 support for Gcc. */
+ {"file", dwarf2_directive_file, 0},
+ {"loc", dwarf2_directive_loc, 0},
+#endif
+
/* The following pseudo-ops are supported for MRI compatibility. */
{"chip", s_chip, 0},
{"comline", s_space, 1},
@@ -3611,6 +3618,11 @@
current_label->text = 1;
current_label = NULL;
}
+
+#ifdef OBJ_ELF
+ /* Tie dwarf2 debug info to the address at the start of the insn. */
+ dwarf2_emit_insn (0);
+#endif
if (the_ins.nfrag == 0)
{
--- config/tc-m68k.h.~1.9.~ Mon Mar 12 09:51:39 2001
+++ config/tc-m68k.h Tue Jul 17 14:06:51 2001
@@ -233,3 +233,5 @@
if (aim==0 && this_state== 4) { /* hard encoded from tc-m68k.c */ \
aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \
}
+
+#define DWARF2_LINE_MIN_INSN_LENGTH 2
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5