* dwarf2dbg.c (dwarf2_directive_loc): Emit duplicate .loc directives.
authorDaniel Jacobowitz <drow@false.org>
Wed, 29 Aug 2007 20:03:43 +0000 (20:03 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 29 Aug 2007 20:03:43 +0000 (20:03 +0000)
* gas/lns/lns-duplicate.d, gas/lns/lns-duplicate.s: New.
* gas/lns/lns.exp: Run lns-duplicate.

gas/ChangeLog
gas/dwarf2dbg.c
gas/testsuite/ChangeLog
gas/testsuite/gas/lns/lns-duplicate.d [new file with mode: 0644]
gas/testsuite/gas/lns/lns-duplicate.s [new file with mode: 0644]
gas/testsuite/gas/lns/lns.exp

index 21aaf0d88ef36cbefa59d9552940c51a95fb6bfe..271643f28fbb733f9b2b719a79fcef6831f408dd 100644 (file)
@@ -1,3 +1,7 @@
+2007-08-29  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * dwarf2dbg.c (dwarf2_directive_loc): Emit duplicate .loc directives.
+
 2007-08-28  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * doc/c-arc.texi: Fix typo.
index 93b5f480b06a340497aca34d23b16bac70d1b179..39e434c012fea69c0eb0314c606db26a40dfae81 100644 (file)
@@ -570,6 +570,11 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
 {
   offsetT filenum, line;
 
+  /* If we see two .loc directives in a row, force the first one to be
+     output now.  */
+  if (loc_directive_seen)
+    dwarf2_emit_insn (0);
+
   filenum = get_absolute_expression ();
   SKIP_WHITESPACE ();
   line = get_absolute_expression ();
index 8127ac80ec5f8ed9272cd49db7c54fea561ed8f5..39c07f04e0e14c27862c2e2d7715c1678bece92d 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-29  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gas/lns/lns-duplicate.d, gas/lns/lns-duplicate.s: New.
+       * gas/lns/lns.exp: Run lns-duplicate.
+
 2007-08-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/i386.exp: Run x86-64-reg and x86-64-reg-intel.
diff --git a/gas/testsuite/gas/lns/lns-duplicate.d b/gas/testsuite/gas/lns/lns-duplicate.d
new file mode 100644 (file)
index 0000000..badf1a2
--- /dev/null
@@ -0,0 +1,10 @@
+#readelf: -wl
+#name: lns-duplicate
+Dump of debug contents of section \.debug_line:
+#...
+ Line Number Statements:
+  Extended opcode 2: set Address to .*
+  Copy
+  Set basic block
+  .* by 1 to 2
+#pass
diff --git a/gas/testsuite/gas/lns/lns-duplicate.s b/gas/testsuite/gas/lns/lns-duplicate.s
new file mode 100644 (file)
index 0000000..9fea2fe
--- /dev/null
@@ -0,0 +1,5 @@
+       .loc_mark_labels 1
+       .file 1 "foo.s"
+       .loc 1 1 0
+       .loc 1 2 0
+.Llabel:
index 2373290e84257b25e4a6a03cd4c1fb733a60bda7..a19236148680f44e32ac7fc45aa37378ce7af8a5 100644 (file)
@@ -4,6 +4,8 @@ if ![is_elf_format] then {
 
 run_list_test "lns-diag-1" ""
 
+run_dump_test "lns-duplicate"
+
 # ??? Won't work on targets that don't have a bare "nop" insn.
 # Perhaps we could arrange for an include file or something that
 # defined a macro...