RFA: MIPS/dwarf-2, GCC part

Daniel Jacobowitz drow@mvista.com
Tue Jun 11 15:23:00 GMT 2002


Mark, is this OK for the branch assuming it looks good on Irix6
(!TARGET_GAS, but uses DWARF-2)?  It fixes a regression, because
MIPS/Linux defaulted to DWARF-2 in GCC 3.1, and it didn't work.

On Tue, Jun 11, 2002 at 05:49:19PM -0400, Daniel Jacobowitz wrote:
> On Tue, Jun 11, 2002 at 03:39:23PM -0400, Daniel Jacobowitz wrote:
> > This patch is withdrawn while I wander through the twisty mess of
> > stabs code.
> 
> And twisty it is.  This one is simpler.  It also has the benefit of not
> affecting non-DWARF-2 compilation (except for one TARGET_GAS case which
> I've quite convinced myself of the safety of).  As such, I'd like to
> see it go in trunk and branch if it passes muster.
> 
> Basically, MIPS was trying to handle ".file" all on its own, and
> dwarf2out was doing the same thing, with different sets of indices.
> 
> -- 
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer

> 2002-06-11  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 have and are using DWARF-2 ".file"
> 	directives already.
> 	(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 -u -r1.176.2.5 mips.c
> --- mips.c	17 Apr 2002 00:42:38 -0000	1.176.2.5
> +++ mips.c	11 Jun 2002 21:44:53 -0000
> @@ -5916,7 +5919,14 @@ mips_output_filename (stream, name)
>    static int first_time = 1;
>    char ltext_label_name[100];
>  
> -  if (first_time)
> +#ifdef HAVE_AS_DWARF2_DEBUG_LINE
> +  /* If we are emitting DWARF-2, let dwarf2out handle the ".file"
> +     directives.  */
> +  if (write_symbols == DWARF2_DEBUG)
> +    return;
> +  else
> +#endif
> +   if (first_time)
>      {
>        first_time = 0;
>        SET_FILE_NUMBER ();
> @@ -6956,7 +6966,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)


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



More information about the Gcc-patches mailing list