* dwarf2dbg.c (dwarf2_consume_line_info): New.

(dwarf2_emit_insn): Use it here.
	(dwarf2_directive_loc): Fix check for consecutive .loc directives
	when debug_type is DEBUG_DWARF2.
	* dwarf2dbg.h (dwarf2_consume_line_info): New prototype.
	* config/tc-ia64.c (ia64_flush_insns): Call dwarf2_consume_line_info.
	(md_assemble): Likewise.
testsuite/
	* gas/lns/lns.exp: Run lns-common-1 with alternate source for ia64.
	* gas/lns/lns-common-1-ia64.s: New file.
This commit is contained in:
Bob Wilson
2007-11-19 18:15:53 +00:00
parent 3e0873ac4f
commit 661ba50f53
7 changed files with 55 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2007-11-19 Bob Wilson <bob.wilson@acm.org>
* dwarf2dbg.c (dwarf2_consume_line_info): New.
(dwarf2_emit_insn): Use it here.
(dwarf2_directive_loc): Fix check for consecutive .loc directives
when debug_type is DEBUG_DWARF2.
* dwarf2dbg.h (dwarf2_consume_line_info): New prototype.
* config/tc-ia64.c (ia64_flush_insns): Call dwarf2_consume_line_info.
(md_assemble): Likewise.
2007-11-17 Thiemo Seufer <ths@mips.com> 2007-11-17 Thiemo Seufer <ths@mips.com>
* config/tc-mips.c (md_parse_option): Match mips_optimize to the -O * config/tc-mips.c (md_parse_option): Match mips_optimize to the -O

View File

@ -1132,6 +1132,7 @@ ia64_flush_insns ()
dwarf2_where (&CURR_SLOT.debug_line); dwarf2_where (&CURR_SLOT.debug_line);
CURR_SLOT.debug_line.flags |= DWARF2_FLAG_BASIC_BLOCK; CURR_SLOT.debug_line.flags |= DWARF2_FLAG_BASIC_BLOCK;
dwarf2_gen_line_info (frag_now_fix (), &CURR_SLOT.debug_line); dwarf2_gen_line_info (frag_now_fix (), &CURR_SLOT.debug_line);
dwarf2_consume_line_info ();
} }
CURR_SLOT.label_fixups = 0; CURR_SLOT.label_fixups = 0;
@ -10968,6 +10969,7 @@ md_assemble (str)
CURR_SLOT.idesc = idesc; CURR_SLOT.idesc = idesc;
as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line); as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line);
dwarf2_where (&CURR_SLOT.debug_line); dwarf2_where (&CURR_SLOT.debug_line);
dwarf2_consume_line_info ();
/* Add unwind entries, if there are any. */ /* Add unwind entries, if there are any. */
if (unwind.current_entry) if (unwind.current_entry)

View File

@ -373,11 +373,6 @@ dwarf2_emit_insn (int size)
or the physical input file name (foo.s) and not the file name or the physical input file name (foo.s) and not the file name
specified in the most recent .loc directive (eg foo.h). */ specified in the most recent .loc directive (eg foo.h). */
loc = current; loc = current;
/* Unless we generate DWARF2 debugging information for each
assembler line, we only emit one line symbol for one LOC. */
if (debug_type != DEBUG_DWARF2)
loc_directive_seen = FALSE;
} }
else if (debug_type != DEBUG_DWARF2) else if (debug_type != DEBUG_DWARF2)
return; return;
@ -385,6 +380,21 @@ dwarf2_emit_insn (int size)
dwarf2_where (&loc); dwarf2_where (&loc);
dwarf2_gen_line_info (frag_now_fix () - size, &loc); dwarf2_gen_line_info (frag_now_fix () - size, &loc);
dwarf2_consume_line_info ();
}
/* Called after the current line information has been either used with
dwarf2_gen_line_info or saved with a machine instruction for later use.
This resets the state of the line number information to reflect that
it has been used. */
void
dwarf2_consume_line_info (void)
{
/* Unless we generate DWARF2 debugging information for each
assembler line, we only emit one line symbol for one LOC. */
if (debug_type != DEBUG_DWARF2)
loc_directive_seen = FALSE;
current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK
| DWARF2_FLAG_PROLOGUE_END | DWARF2_FLAG_PROLOGUE_END
@ -572,7 +582,7 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
/* If we see two .loc directives in a row, force the first one to be /* If we see two .loc directives in a row, force the first one to be
output now. */ output now. */
if (loc_directive_seen) if (loc_directive_seen && debug_type != DEBUG_DWARF2)
dwarf2_emit_insn (0); dwarf2_emit_insn (0);
filenum = get_absolute_expression (); filenum = get_absolute_expression ();

View File

@ -72,6 +72,10 @@ extern void dwarf2_gen_line_info (addressT addr, struct dwarf2_line_info *l);
/* Must be called for each generated instruction. */ /* Must be called for each generated instruction. */
extern void dwarf2_emit_insn (int); extern void dwarf2_emit_insn (int);
/* Reset the state of the line number information to reflect that
it has been used. */
extern void dwarf2_consume_line_info (void);
/* Should be called for each code label. */ /* Should be called for each code label. */
extern void dwarf2_emit_label (symbolS *); extern void dwarf2_emit_label (symbolS *);

View File

@ -1,3 +1,8 @@
2007-11-19 Bob Wilson <bob.wilson@acm.org>
* gas/lns/lns.exp: Run lns-common-1 with alternate source for ia64.
* gas/lns/lns-common-1-ia64.s: New file.
2007-11-14 H.J. Lu <hongjiu.lu@intel.com> 2007-11-14 H.J. Lu <hongjiu.lu@intel.com>
* gas/ia64/dv-raw-err.s: Add tests for ar.ruc. * gas/ia64/dv-raw-err.s: Add tests for ar.ruc.

View File

@ -0,0 +1,16 @@
.file 1 "foo.c"
.loc 1 1
.explicit
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 2 3
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 3 prologue_end
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 4 0 epilogue_begin
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 5 isa 1 basic_block
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 6 is_stmt 0
{ .mii; nop 0; nop 0; nop 0 ;; }
.loc 1 7 is_stmt 1
{ .mii; nop 0; nop 0; nop 0 ;; }

View File

@ -13,7 +13,6 @@ run_dump_test "lns-duplicate"
# information (d10v). # information (d10v).
if { if {
![istarget d10v-*-*] ![istarget d10v-*-*]
&& ![istarget ia64*-*-*]
&& ![istarget i370-*-*] && ![istarget i370-*-*]
&& ![istarget i960-*-*] && ![istarget i960-*-*]
&& ![istarget mcore-*-*] && ![istarget mcore-*-*]
@ -23,6 +22,8 @@ if {
# Use alternate file for targets using DW_LNS_fixed_advance_pc opcodes. # Use alternate file for targets using DW_LNS_fixed_advance_pc opcodes.
if { [istarget xtensa-*-*] } { if { [istarget xtensa-*-*] } {
run_dump_test "lns-common-1-alt" run_dump_test "lns-common-1-alt"
} elseif { [istarget ia64*-*-*] } {
run_dump_test "lns-common-1" { { source "lns-common-1-ia64.s" } }
} else { } else {
run_dump_test "lns-common-1" run_dump_test "lns-common-1"
} }