[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assembler error when dwarf2 debug information from gcc-3.1
From: |
Nick Clifton |
Subject: |
Re: assembler error when dwarf2 debug information from gcc-3.1 |
Date: |
11 May 2002 11:29:26 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 |
Hi Bruno,
> $ as --gdwarf2 -o exam.o exam.s
> exam.s: Assembler messages:
> exam.s:216: Error: file number 53 already allocated
>
> What happens here? dwarf2_emit_insn detects that a .loc directive has
> recently been seen and now is the first insn after it. So it should
> output the 'current' line info that was filled by dwarf2_directive_loc.
> But what it does is to call dwarf2_where which calls as_where which
> returns one of logical_input_file (= "exam.cc") and physical_input_file
> (= "exam.s") - both are inappropriate here.
>
> So here is a fix.
Thanks for submitting this patch. I have applied it along with an
additional comment explaining what is going on.
Cheers
Nick
Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.46
diff -c -3 -p -w -p -r1.46 dwarf2dbg.c
*** gas/dwarf2dbg.c 3 May 2002 02:25:33 -0000 1.46
--- gas/dwarf2dbg.c 11 May 2002 10:26:52 -0000
*************** dwarf2_emit_insn (size)
*** 290,296 ****
return;
loc_directive_seen = false;
! dwarf2_where (&loc);
dwarf2_gen_line_info (frag_now_fix () - size, &loc);
}
--- 290,301 ----
return;
loc_directive_seen = false;
! /* Use the last location established by a .loc directive, not
! the value returned by dwarf2_where(). That calls as_where()
! which will return either the logical input file name (foo.c)
! or the physical input file name (foo.s) and not the file name
! specified in the most recent .loc directive (eg foo.h). */
! loc = current;
dwarf2_gen_line_info (frag_now_fix () - size, &loc);
}