This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix 4 current darwin pch debug regressions


These fix the 4 pch regressions reported by the tester.

It turns out all of the debug writers but dwarf2 don't want to see start
and end source file calls for the main source file (which was added to
fix the macro debug info output for dwarf2).
As a result, i've simply made it a debug hook and defaulted it to 0 for
all but the dwarf2 writer, which restores the behavior the other debug
writers were used to.

Bootstrapped and regtested on powerpc-darwin.

Okay for 4.0 and mainline?


2005-03-19  Daniel Berlin  <dberlin@dberlin.org>

	* c-opts.c (c_common_parse_file): Only start/end main source file
	if debug hooks says the writer wants it.
	* dbxout.c (dbx_debug_hooks): Add start_end_main_source_file
	member.
	(xcoff_debug_hooks): Ditto.
	* debug.c (do_nothing_hooks): Ditto.
	* debug.h (gcc_debug_hooks): Ditto.
	* dwarf2out.c (dwarf2_debug_hooks): Ditto.
	* sdbout.c (sdb_debug_hooks): Ditto.
	* vmsdbgout.c (vmsdbg_debug_hooks): Ditto.

Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.139
diff -u -p -r1.139 c-opts.c
--- c-opts.c	15 Mar 2005 00:36:14 -0000	1.139
+++ c-opts.c	17 Mar 2005 16:09:08 -0000
@@ -1102,16 +1102,18 @@ c_common_parse_file (int set_yydebug)
   i = 0;
   for (;;)
     {
-      /* Start the main input file */
-      (*debug_hooks->start_source_file) (0, this_input_filename);
+      /* Start the main input file, if the debug writer wants it. */
+      if (debug_hooks->start_end_main_source_file)
+	(*debug_hooks->start_source_file) (0, this_input_filename);
       finish_options ();
       pch_init ();
       push_file_scope ();
       c_parse_file ();
       finish_file ();
       pop_file_scope ();
-      /* And end the main input file.  */
-      (*debug_hooks->end_source_file) (0);
+      /* And end the main input file, if the debug writer wants it  */
+      if (debug_hooks->start_end_main_source_file)
+	(*debug_hooks->end_source_file) (0);
       if (++i >= num_in_fnames)
 	break;
       cpp_undef_all (parse_in);
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.221
diff -u -p -r1.221 dbxout.c
--- dbxout.c	21 Feb 2005 10:06:20 -0000	1.221
+++ dbxout.c	17 Mar 2005 16:09:08 -0000
@@ -378,7 +378,8 @@ const struct gcc_debug_hooks dbx_debug_h
   debug_nothing_tree,		         /* outlining_inline_function */
   debug_nothing_rtx,		         /* label */
   dbxout_handle_pch,		         /* handle_pch */
-  debug_nothing_rtx		         /* var_location */
+  debug_nothing_rtx,		         /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 #endif /* DBX_DEBUGGING_INFO  */
 
@@ -408,7 +409,8 @@ const struct gcc_debug_hooks xcoff_debug
   debug_nothing_tree,		         /* outlining_inline_function */
   debug_nothing_rtx,		         /* label */
   dbxout_handle_pch,		         /* handle_pch */
-  debug_nothing_rtx		         /* var_location */
+  debug_nothing_rtx,		         /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 #endif /* XCOFF_DEBUGGING_INFO  */
 
Index: debug.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/debug.c,v
retrieving revision 1.17
diff -u -p -r1.17 debug.c
--- debug.c	12 Feb 2004 21:42:17 -0000	1.17
+++ debug.c	17 Mar 2005 16:09:08 -0000
@@ -47,7 +47,8 @@ const struct gcc_debug_hooks do_nothing_
   debug_nothing_tree,		         /* outlining_inline_function */
   debug_nothing_rtx,		         /* label */
   debug_nothing_int,		         /* handle_pch */
-  debug_nothing_rtx		         /* var_location */
+  debug_nothing_rtx,		         /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 
 /* This file contains implementations of each debug hook that do
Index: debug.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/debug.h,v
retrieving revision 1.19
diff -u -p -r1.19 debug.h
--- debug.h	12 Feb 2004 21:42:17 -0000	1.19
+++ debug.h	17 Mar 2005 16:09:08 -0000
@@ -119,6 +119,10 @@ struct gcc_debug_hooks
 
   /* Called from final_scan_insn for any NOTE_INSN_VAR_LOCATION note.  */
   void (* var_location) (rtx);
+
+  /* This is 1 if the debug writer wants to see start and end commands for the
+     main source files, and 0 otherwise.  */
+  int start_end_main_source_file;
 };
 
 extern const struct gcc_debug_hooks *debug_hooks;
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.571
diff -u -p -r1.571 dwarf2out.c
--- dwarf2out.c	4 Mar 2005 03:08:04 -0000	1.571
+++ dwarf2out.c	17 Mar 2005 16:09:08 -0000
@@ -3444,7 +3444,8 @@ const struct gcc_debug_hooks dwarf2_debu
   dwarf2out_abstract_function,	/* outlining_inline_function */
   debug_nothing_rtx,		/* label */
   debug_nothing_int,		/* handle_pch */
-  dwarf2out_var_location
+  dwarf2out_var_location,
+  1                             /* start_end_main_source_file */
 };
 #endif
 
Index: sdbout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sdbout.c,v
retrieving revision 1.98
diff -u -p -r1.98 sdbout.c
--- sdbout.c	4 Nov 2004 13:23:18 -0000	1.98
+++ sdbout.c	17 Mar 2005 16:09:08 -0000
@@ -335,7 +335,8 @@ const struct gcc_debug_hooks sdb_debug_h
   debug_nothing_tree,		         /* outlining_inline_function */
   sdbout_label,			         /* label */
   debug_nothing_int,		         /* handle_pch */
-  debug_nothing_rtx		         /* var_location */
+  debug_nothing_rtx,		         /* var_location */
+  0                                      /* start_end_main_source_file */
 };
 
 /* Return a unique string to name an anonymous type.  */
Index: vmsdbgout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vmsdbgout.c,v
retrieving revision 1.39
diff -u -p -r1.39 vmsdbgout.c
--- vmsdbgout.c	12 Mar 2005 00:34:04 -0000	1.39
+++ vmsdbgout.c	17 Mar 2005 16:09:08 -0000
@@ -209,7 +209,8 @@ const struct gcc_debug_hooks vmsdbg_debu
    vmsdbgout_abstract_function,
    debug_nothing_rtx,		  /* label */
    debug_nothing_int,		  /* handle_pch */
-   debug_nothing_rtx		  /* var_location */
+   debug_nothing_rtx,		  /* var_location */
+   0                              /* start_end_main_source_file */
 };
 
 /* Definitions of defaults for assembler-dependent names of various

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]