This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Do not reset loc_directive_seen in dwarf2_emit_insn
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 13 May 2002 11:23:16 +0100
- Subject: Do not reset loc_directive_seen in dwarf2_emit_insn
Hi Guys,
I am applying the patch below (mainline only) to fix a further
problem with dwarf2_emit_insn(). The code used to reset the
variable 'loc_directive_seen' which means that the bug detected and
fixed by Bruno Haible could in theory resurface.
Since a .loc directive remains valid up until the next .loc
directive, there is no need to reset the variable, so this patch
just eliminates that reset.
Cheers
Nick
2002-05-13 Nick Clifton <nickc@cambridge.redhat.com>
* dwarf2dbg.c (dwarf2_emit_insn): Do not reset
loc_directive_seen.
Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.47
diff -c -3 -p -w -r1.47 dwarf2dbg.c
*** gas/dwarf2dbg.c 11 May 2002 10:32:35 -0000 1.47
--- gas/dwarf2dbg.c 13 May 2002 10:19:29 -0000
*************** dwarf2_emit_insn (size)
*** 286,301 ****
{
struct dwarf2_line_info loc;
! if (debug_type != DEBUG_DWARF2 && ! loc_directive_seen)
! 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);
}
--- 286,303 ----
{
struct dwarf2_line_info loc;
! if (loc_directive_seen)
/* 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;
+ else if (debug_type != DEBUG_DWARF2)
+ return;
+ else
+ dwarf2_where (& loc);
+
dwarf2_gen_line_info (frag_now_fix () - size, &loc);
}