*** empty log message ***
[deliverable/binutils-gdb.git] / gas / dwarf2dbg.c
index 8b7005b2b5ca31903ef63c578e72eaf705d63aa5..94d9f7972ce65489f4ca855333255d632316e4d0 100644 (file)
@@ -286,16 +286,25 @@ dwarf2_emit_insn (size)
 {
   struct dwarf2_line_info loc;
 
-  if (debug_type != DEBUG_DWARF2 && ! loc_directive_seen)
+  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;
+
+      /* 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)
     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;
+  else
+    dwarf2_where (& loc);
+
   dwarf2_gen_line_info (frag_now_fix () - size, &loc);
 }
 
@@ -419,7 +428,10 @@ dwarf2_directive_loc (dummy)
 
 #ifndef NO_LISTING
   if (listing)
-    listing_source_line (line);
+    {
+      listing_source_file (files[filenum].filename);
+      listing_source_line (line);
+    }
 #endif
 }
 \f
This page took 0.024788 seconds and 4 git commands to generate.