zlaski      02/10/01 17:49:14

  Modified:    gcc      dbxout.c dbxout.h toplev.c
  Log:
  Fix PFE dump-time stdout spewage, and ensure that the dbxout debug_hooks
  are initialized early enough.
  
  Revision  Changes    Path
  1.32      +5 -15     gcc3/gcc/dbxout.c
  
  Index: dbxout.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/dbxout.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- dbxout.c  2002/09/25 19:31:20     1.31
  +++ dbxout.c  2002/10/02 00:49:09     1.32
  @@ -178,7 +178,7 @@
       dbxout_save_arguments (code, arg1, arg2);        \
   
   /* Layout of a dbxout_data_array entry.  Each entry variant depends on
  -   it's dbxout_code.  */
  +   its dbxout_code.  */
   struct dbxout_stabs_t {
     ENUM_BITFIELD(dbxout_code) code;
     
  @@ -216,7 +216,7 @@
     } u;
   };
   
  -/* Here's dbxout_data_array and data controlling it's growth.  */
  +/* Here's dbxout_data_array and data controlling its growth.  */
   static struct dbxout_stabs_t *dbxout_data_array = NULL;
   #define DBXOUT_DATA_ARRAY_INITIAL_SIZE 40000
   #define DBXOUT_DATA_ARRAY_INCR         10000
  @@ -225,7 +225,6 @@
   static int dbxout_data_array_incr = DBXOUT_DATA_ARRAY_INITIAL_SIZE;
   
   static void freeze_thaw_dbxout_data_array PARAMS ((struct dbxout_stabs_t **));
  -static void dbxout_generate_loaded_stabs  PARAMS ((void));
   static void dbxout_save_arguments      PARAMS ((enum dbxout_code code, ...));
   
   static void dbxout_intercept_init PARAMS ((const char *main_filename));
  @@ -249,7 +248,7 @@
   static void dbxout_intercept_outlining_inline_function PARAMS ((union tree_node 
*decl));
   static void dbxout_intercept_label PARAMS ((struct rtx_def *insn));
   
  -static struct gcc_debug_hooks intercept_debug_hooks =
  +struct gcc_debug_hooks intercept_debug_hooks =
   {
     dbxout_intercept_init,
     dbxout_intercept_finish,
  @@ -273,7 +272,7 @@
     dbxout_intercept_label
   };
   
  -static struct gcc_debug_hooks *actual_debug_hooks;
  +struct gcc_debug_hooks *actual_debug_hooks;
   /* APPLE LOCAL end PFE */
   
   /* APPLE LOCAL begin gdb only used symbols */
  @@ -719,11 +718,6 @@
        when loading.  */
     if (!PFE_LOADING)
       {
  -      if (PFE_DUMPING)
  -        {
  -       actual_debug_hooks = debug_hooks;
  -       debug_hooks        = &intercept_debug_hooks;
  -     }
   
   #ifdef DBX_OUTPUT_STANDARD_TYPES
         DBX_OUTPUT_STANDARD_TYPES (syms);
  @@ -740,10 +734,6 @@
       
         dbxout_typedefs (syms);
       }
  -  else if (debug_hooks != &do_nothing_debug_hooks)
  -    {
  -      dbxout_generate_loaded_stabs ();
  -    }
     /* APPLE LOCAL end PFE */
   }
   
  @@ -3515,7 +3505,7 @@
   
   /* Called from dbxout_init() to regenerate the debug info from the
      dbxout_data_array saved in a pfe load file.  */
  -static void
  +void
   dbxout_generate_loaded_stabs ()
   {
     int i;
  
  
  
  1.3       +8 -0      gcc3/gcc/dbxout.h
  
  Index: dbxout.h
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/dbxout.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dbxout.h  2001/09/14 00:46:56     1.2
  +++ dbxout.h  2002/10/02 00:49:10     1.3
  @@ -18,6 +18,14 @@
   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.  */
   
  +/* APPLE LOCAL begin PFE */
  +#include "debug.h"
  +
  +extern struct gcc_debug_hooks intercept_debug_hooks;
  +extern struct gcc_debug_hooks *actual_debug_hooks;
  +extern void dbxout_generate_loaded_stabs  PARAMS ((void));
  +/* APPLE LOCAL end PFE */
  +
   extern int dbxout_symbol             PARAMS ((tree, int));
   extern void dbxout_parms             PARAMS ((tree));
   extern void dbxout_reg_parms         PARAMS ((tree));
  
  
  
  1.158     +19 -3     gcc3/gcc/toplev.c
  
  Index: toplev.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/toplev.c,v
  retrieving revision 1.157
  retrieving revision 1.158
  diff -u -r1.157 -r1.158
  --- toplev.c  2002/09/23 22:52:36     1.157
  +++ toplev.c  2002/10/02 00:49:10     1.158
  @@ -4971,10 +4971,10 @@
        const char *name;
   {
     /* APPLE LOCAL begin PFE */
  -  /* A PFE dump implies that no .o should be created.  */
  +  /* A PFE dump implies that no .s should be created.  */
     if (PFE_DUMPING)
       {
  -      asm_out_file = stdout;
  +      asm_out_file = fopen ("/dev/null", "a");
         return;
       }
     /* APPLE LOCAL end PFE */
  @@ -5739,7 +5739,23 @@
   
     /* Now we have the correct original filename, we can initialize
        debug output.  */
  -  (*debug_hooks->init) (name);
  +  /* APPLE LOCAL begin PFE */     
  +  if (PFE_DUMPING)
  +    {
  +      /* When creating a PFE precomp, we intercept all the 'dbxout...' calls
  +      and write out all their arguments to a file.  During a PFE load, these
  +      calls will be "played back" using the loaded arguments.  */
  +      actual_debug_hooks = debug_hooks;
  +      debug_hooks        = &intercept_debug_hooks;
  +      (*debug_hooks->init) (name);
  +    }
  +  else if (PFE_LOADING && debug_hooks != &do_nothing_debug_hooks)
  +    {
  +      dbxout_generate_loaded_stabs ();
  +    }
  +  else  
  +    (*debug_hooks->init) (name);
  +  /* APPLE LOCAL end PFE */     
   
     timevar_pop (TV_SYMOUT);
   
  
  
  


Reply via email to