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]

More DBX cleanups


This patch poisons the macros that I forgot to poison the last time
round, + I removed some more macros that were never defined to
anything other than the default.

Bootstrapped amd64-linux.

zw

        * dbxout.c: Remove unnecessary #undefs.
        (GDB_INV_REF_REGPARM_STABS_LETTER, DBX_MEMPARM_STABS_LETTER)
        (FILE_NAME_JOINER, STABS_GCC_MARKER): Remove; fold sole
        definition into use sites.
        (cwd): Make local to dbxout_init.
        (dbxout_init): Restructure cwd-using logic for clarity.  Use
        IS_DIR_SEPARATOR.
        * xcoffout.h (DBX_OUTPUT_GCC_MARKER): Definition of
        STABS_GCC_MARKER folded in here.
        * system.h: Poison now-unused macros.
        * doc/tm.texi: Remove documentation of now-unused macros.

===================================================================
Index: dbxout.c
--- dbxout.c	21 Oct 2004 14:53:09 -0000	1.207
+++ dbxout.c	21 Oct 2004 17:14:36 -0000
@@ -93,12 +93,10 @@ Software Foundation, 59 Temple Place - S
 #include "xcoffout.h"
 #endif
 
-#undef DBXOUT_DECR_NESTING
 #define DBXOUT_DECR_NESTING \
   if (--debug_nesting == 0 && symbol_queue_index > 0) \
     { emit_pending_bincls_if_required (); debug_flush_symbol_queue (); }
 
-#undef DBXOUT_DECR_NESTING_AND_RETURN
 #define DBXOUT_DECR_NESTING_AND_RETURN(x) \
   do {--debug_nesting; return (x);} while (0)
 
@@ -126,26 +124,6 @@ Software Foundation, 59 Temple Place - S
 #define DBX_REGPARM_STABS_LETTER 'P'
 #endif
 
-/* This is used for parameters passed by invisible reference in a register.  */
-#ifndef GDB_INV_REF_REGPARM_STABS_LETTER
-#define GDB_INV_REF_REGPARM_STABS_LETTER 'a'
-#endif
-
-#ifndef DBX_MEMPARM_STABS_LETTER
-#define DBX_MEMPARM_STABS_LETTER 'p'
-#endif
-
-#ifndef FILE_NAME_JOINER
-#define FILE_NAME_JOINER "/"
-#endif
-
-/* GDB needs to know that the stabs were generated by GCC.  We emit an
-   N_OPT stab at the beginning of the source file to indicate this.
-   The string is historical, and different on a very few targets.  */
-#ifndef STABS_GCC_MARKER
-#define STABS_GCC_MARKER "gcc2_compiled."
-#endif
-
 #ifndef NO_DBX_FUNCTION_END
 #define NO_DBX_FUNCTION_END 0
 #endif
@@ -275,10 +253,6 @@ static int pending_bincls = 0;
 /* The original input file name.  */
 static const char *base_input_file;
 
-/* Current working directory.  */
-
-static const char *cwd;
-
 #ifdef DEBUG_SYMS_TEXT
 #define FORCE_TEXT function_section (current_function_decl);
 #else
@@ -546,21 +520,26 @@ dbxout_init (const char *input_file_name
   /* Put the current working directory in an N_SO symbol.  */
   if (use_gnu_debug_info_extensions)
     {
-      if (!cwd && (cwd = get_src_pwd ())
-	  && (!*cwd || cwd[strlen (cwd) - 1] != '/'))
-	cwd = concat (cwd, FILE_NAME_JOINER, NULL);
-      if (cwd)
+      static const char *cwd;
+
+      if (!cwd)
 	{
+	  cwd = get_src_pwd ();
+	  if (cwd[0] == '\0')
+	    cwd = "/";
+	  else if (!IS_DIR_SEPARATOR (cwd[strlen (cwd) - 1]))
+	    cwd = concat (cwd, "/", NULL);
+	}
+
 #ifdef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
-	  DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (asm_out_file, cwd);
+      DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (asm_out_file, cwd);
 #else /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
-	  fprintf (asm_out_file, "%s", ASM_STABS_OP);
-	  output_quoted_string (asm_out_file, cwd);
-	  fprintf (asm_out_file, ",%d,0,%d,", N_SO, get_lang_number ());
-	  assemble_name (asm_out_file, ltext_label_name);
-	  fputc ('\n', asm_out_file);
+      fprintf (asm_out_file, "%s", ASM_STABS_OP);
+      output_quoted_string (asm_out_file, cwd);
+      fprintf (asm_out_file, ",%d,0,%d,", N_SO, get_lang_number ());
+      assemble_name (asm_out_file, ltext_label_name);
+      fputc ('\n', asm_out_file);
 #endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */
-	}
     }
 
 #ifdef DBX_OUTPUT_MAIN_SOURCE_FILENAME
@@ -581,9 +560,10 @@ dbxout_init (const char *input_file_name
 #ifdef DBX_OUTPUT_GCC_MARKER
   DBX_OUTPUT_GCC_MARKER (asm_out_file);
 #else
-  /* Emit an N_OPT stab to indicate that this file was compiled by GCC.  */
-  fprintf (asm_out_file, "%s\"%s\",%d,0,0,0\n",
-	   ASM_STABS_OP, STABS_GCC_MARKER, N_OPT);
+  /* Emit an N_OPT stab to indicate that this file was compiled by GCC.
+     The string used is historical.  */
+  fprintf (asm_out_file, "%s\"gcc2_compiled.\",%d,0,0,0\n",
+	   ASM_STABS_OP, N_OPT);
 #endif
 
   base_input_file = lastfile = input_file_name;
@@ -2865,16 +2845,13 @@ dbxout_parms (tree parms)
 	    if (DECL_NAME (parms))
 	      {
 		current_sym_nchars = 2 + IDENTIFIER_LENGTH (DECL_NAME (parms));
-
-		fprintf (asm_out_file, "%s\"%s:%c", ASM_STABS_OP,
-			 IDENTIFIER_POINTER (DECL_NAME (parms)),
-			 DBX_MEMPARM_STABS_LETTER);
+		fprintf (asm_out_file, "%s\"%s:p", ASM_STABS_OP,
+			 IDENTIFIER_POINTER (DECL_NAME (parms)));
 	      }
 	    else
 	      {
 		current_sym_nchars = 8;
-		fprintf (asm_out_file, "%s\"(anon):%c", ASM_STABS_OP,
-			 DBX_MEMPARM_STABS_LETTER);
+		fprintf (asm_out_file, "%s\"(anon):p", ASM_STABS_OP);
 	      }
 
 	    /* It is quite tempting to use:
@@ -2964,8 +2941,10 @@ dbxout_parms (tree parms)
 	    /* Parm passed in registers and lives in registers or nowhere.  */
 
 	    current_sym_code = DBX_REGPARM_STABS_CODE;
+
 	    if (use_gnu_debug_info_extensions)
-	      regparm_letter = GDB_INV_REF_REGPARM_STABS_LETTER;
+	      /* GDB likes this marked with a special letter.  */
+	      regparm_letter = 'a';
 	    else
 	      regparm_letter = DBX_REGPARM_STABS_LETTER;
 
@@ -3065,15 +3044,13 @@ dbxout_parms (tree parms)
 		current_sym_nchars
 		  = 2 + strlen (IDENTIFIER_POINTER (DECL_NAME (parms)));
 
-		fprintf (asm_out_file, "%s\"%s:%c", ASM_STABS_OP,
-			 IDENTIFIER_POINTER (DECL_NAME (parms)),
-			 DBX_MEMPARM_STABS_LETTER);
+		fprintf (asm_out_file, "%s\"%s:p", ASM_STABS_OP,
+			 IDENTIFIER_POINTER (DECL_NAME (parms)));
 	      }
 	    else
 	      {
 		current_sym_nchars = 8;
-		fprintf (asm_out_file, "%s\"(anon):%c", ASM_STABS_OP,
-		DBX_MEMPARM_STABS_LETTER);
+		fprintf (asm_out_file, "%s\"(anon):p", ASM_STABS_OP);
 	      }
 
 	    current_sym_value
===================================================================
Index: system.h
--- system.h	6 Oct 2004 22:20:31 -0000	1.230
+++ system.h	21 Oct 2004 17:14:39 -0000
@@ -653,7 +653,10 @@ extern void fancy_abort (const char *, i
 	SUNOS4_SHARED_LIBRARIES PROMOTE_FOR_CALL_ONLY			   \
 	SPACE_AFTER_L_OPTION NO_RECURSIVE_FUNCTION_CSE			   \
 	DEFAULT_MAIN_RETURN TARGET_MEM_FUNCTIONS EXPAND_BUILTIN_VA_ARG	   \
-	COLLECT_PARSE_FLAG DWARF2_GENERATE_TEXT_SECTION_LABEL
+	COLLECT_PARSE_FLAG DWARF2_GENERATE_TEXT_SECTION_LABEL WINNING_GDB  \
+	ASM_OUTPUT_FILENAME ASM_OUTPUT_SOURCE_LINE FILE_NAME_JOINER	   \
+	GDB_INV_REF_REGPARM_STABS_LETTER DBX_MEMPARM_STABS_LETTER	   \
+	PUT_SDB_SRC_FILE STABS_GCC_MARKER
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
===================================================================
Index: xcoffout.h
--- xcoffout.h	21 Oct 2004 14:53:11 -0000	1.25
+++ xcoffout.h	21 Oct 2004 17:14:47 -0000
@@ -153,7 +153,7 @@ extern const char *xcoff_lastfile;
 /* .stabx has the type in a different place.  */
 #if 0  /* Do not emit any marker for XCOFF until assembler allows XFT_CV.  */
 #define DBX_OUTPUT_GCC_MARKER(FILE) \
-  fprintf ((FILE), "%s\"%s\",0,%d,0\n", ASM_STABS_OP, STABS_GCC_MARKER, \
+  fprintf ((FILE), "%s\"gcc2_compiled.\",0,%d,0\n", ASM_STABS_OP, \
 	   stab_to_sclass (N_GSYM))
 #else
 #define DBX_OUTPUT_GCC_MARKER(FILE)
===================================================================
Index: doc/tm.texi
--- doc/tm.texi	21 Oct 2004 00:53:47 -0000	1.382
+++ doc/tm.texi	21 Oct 2004 17:15:04 -0000
@@ -7966,11 +7966,6 @@ passed in registers.  DBX format does no
 do this.  The default is @code{'P'}.
 @end defmac
 
-@defmac DBX_MEMPARM_STABS_LETTER
-The letter to use in DBX symbol data to identify a symbol as a stack
-parameter.  The default is @code{'p'}.
-@end defmac
-
 @defmac DBX_FUNCTION_FIRST
 Define this macro if the DBX information for a function and its
 arguments should precede the assembler code for the function.  Normally,


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