diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f36508315ef..ac65d524d60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2004-10-21 Zack Weinberg + + * 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. + 2004-10-21 Andrew Pinski PR c/17538 diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 9f8c37aefb0..077cc498a32 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -93,12 +93,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #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 - Suite 330, Boston, MA #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) { -#ifdef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY - 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); -#endif /* no DBX_OUTPUT_MAIN_SOURCE_DIRECTORY */ + 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); +#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); +#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 diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index adffe8f7d62..d7e13e9b041 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7966,11 +7966,6 @@ passed in registers. DBX format does not customarily provide any way to 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, diff --git a/gcc/system.h b/gcc/system.h index bdfe2953f24..56f5ff028eb 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -653,7 +653,10 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; 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 \ diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h index 21d2b838c4a..597d8e1c081 100644 --- a/gcc/xcoffout.h +++ b/gcc/xcoffout.h @@ -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)