dbxout.c overhaul, finally done

Richard Sandiford rsandifo@redhat.com
Wed Oct 27 17:45:00 GMT 2004


This bit...

Zack Weinberg <zack@codesourcery.com> writes:
> @@ -789,29 +1233,22 @@ dbxout_begin_prologue (unsigned int line
>  static void
>  dbxout_source_line (unsigned int lineno, const char *filename)
>  {
> -  dbxout_source_file (asm_out_file, filename);
> +  const char *begin_label = XSTR(XEXP(DECL_RTL(current_function_decl), 0), 0);
> +
> +  dbxout_source_file (filename);
>  
>  #ifdef DBX_OUTPUT_SOURCE_LINE
> -  dbxout_source_line_counter += 1;
>    DBX_OUTPUT_SOURCE_LINE (asm_out_file, lineno, dbxout_source_line_counter);
>  #else
>    if (DBX_LINES_FUNCTION_RELATIVE)
>      {
> -      char label[100];
> -      dbxout_source_line_counter += 1;
> +      dbxout_begin_stabn_sline (lineno);
> +      dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
> +					     begin_label);
>  
> -      ASM_GENERATE_INTERNAL_LABEL (label, "LM", dbxout_source_line_counter);
> -      fprintf (asm_out_file, "%s%d,0,%d,", ASM_STABN_OP, N_SLINE, lineno);
> -      assemble_name (asm_out_file, label);
> -      putc ('-', asm_out_file);
> -      assemble_name (asm_out_file,
> -		     XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
> -      putc ('\n', asm_out_file);
> -      targetm.asm_out.internal_label (asm_out_file, "LM",
> -				      dbxout_source_line_counter);
>      }
>    else
> -    fprintf (asm_out_file, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno);
> +    dbxout_stabd (N_SLINE, lineno);
>  #endif
>  }

...broke bootstrap on targets that define DBX_OUTPUT_SOURCE_LINE,
because begin_label is only used in the #else block.  Fixed with the
patch below.  Bootstrapped on mips64-linux-gnu to make sure that it got
past the source of the failure.  Also bootstrapped on i686-pc-linux-gnu
(for which DBX_LINES_FUNCTION_RELATIVE is true) and tested with -gstabs+.
Committed as obvious.

Richard


	* dbxout.c (dbxout_source_line): Move declaration of begin_label to
	the block that needs it.

Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.211
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.211 dbxout.c
--- dbxout.c	27 Oct 2004 01:29:39 -0000	1.211
+++ dbxout.c	27 Oct 2004 17:17:11 -0000
@@ -1233,8 +1233,6 @@ dbxout_begin_prologue (unsigned int line
 static void
 dbxout_source_line (unsigned int lineno, const char *filename)
 {
-  const char *begin_label = XSTR(XEXP(DECL_RTL(current_function_decl), 0), 0);
-
   dbxout_source_file (filename);
 
 #ifdef DBX_OUTPUT_SOURCE_LINE
@@ -1242,9 +1240,10 @@ dbxout_source_line (unsigned int lineno,
 #else
   if (DBX_LINES_FUNCTION_RELATIVE)
     {
+      rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0);
       dbxout_begin_stabn_sline (lineno);
       dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
-					     begin_label);
+					     XSTR (begin_label, 0));
 
     }
   else



More information about the Gcc-patches mailing list