RFA: MIPS/dwarf-2, GCC part

Daniel Jacobowitz drow@mvista.com
Wed Jun 12 10:29:00 GMT 2002


On Tue, Jun 11, 2002 at 04:30:29PM -0700, Richard Henderson wrote:
> On Tue, Jun 11, 2002 at 06:31:16PM -0400, Daniel Jacobowitz wrote:
> > If you're confident it won't cause any other problems, I'd be glad to
> > remove that conditional.  Figuring out everywhere that the input
> > filename is used in gas turned out to be beyond me.
> 
> Emitting '.file "filename.c"' as opposed to ".file 1 "filename.c"'
> will do two things:
> 
> (1) Emit a BSF_FILE symbol.
> (2) Fiddle things for the -al listing.
> 
> I suppose (1) might be incentive to keep the thing, but I've not
> missed it on Alpha.

Good enough for me, and it's cleaner this way too.  And it survived
bootstrap/compare, so we aren't picking up the temporary filename
anywhere.  Here's a new version.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-06-12  Daniel Jacobowitz  <drow@mvista.com>

	* config/mips/elf.h (DWARF2_DEBUG_INFO): Define.
	* config/mips/mips.c (mips_output_filename): Don't print a
	".file" directive if we are using DWARF-2.
	(mips_output_function_prologue): Do not emit source file
	name for TARGET_GAS.

Index: gcc/config/mips/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/elf.h,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 elf.h
--- gcc/config/mips/elf.h	11 Nov 2001 05:56:43 -0000	1.34
+++ gcc/config/mips/elf.h	7 Jun 2002 01:09:02 -0000
@@ -22,6 +22,12 @@ Boston, MA 02111-1307, USA.  */
 /* Use ELF.  */
 #define OBJECT_FORMAT_ELF
 
+/* All ELF targets can support DWARF-2.  */
+
+#ifndef DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
+#endif
+
 /* Until we figure out what MIPS ELF targets normally use, just do
    stabs in ELF.  */
 #ifndef PREFERRED_DEBUGGING_TYPE
Index: mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.176.2.5
diff -u -p -r1.176.2.5 mips.c
--- mips.c	17 Apr 2002 00:42:38 -0000	1.176.2.5
+++ mips.c	12 Jun 2002 17:14:47 -0000
@@ -5916,7 +5919,11 @@ mips_output_filename (stream, name)
   static int first_time = 1;
   char ltext_label_name[100];
 
-  if (first_time)
+  /* If we are emitting DWARF-2, let dwarf2out handle the ".file"
+     directives.  */
+  if (write_symbols == DWARF2_DEBUG)
+    return;
+  else if (first_time)
     {
       first_time = 0;
       SET_FILE_NUMBER ();
@@ -6956,7 +6963,11 @@ mips_output_function_prologue (file, siz
 #endif
   HOST_WIDE_INT tsize = current_frame_info.total_size;
 
-  ASM_OUTPUT_SOURCE_FILENAME (file, DECL_SOURCE_FILE (current_function_decl));
+  /* ??? When is this really needed?  At least the GNU assembler does not
+     need the source filename more than once in the file, beyond what is
+     emitted by the debug information.  */
+  if (!TARGET_GAS)
+    ASM_OUTPUT_SOURCE_FILENAME (file, DECL_SOURCE_FILE (current_function_decl));
 
 #ifdef SDB_DEBUGGING_INFO
   if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)



More information about the Gcc-patches mailing list