diff options
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r-- | gcc/dbxout.c | 139 |
1 files changed, 66 insertions, 73 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 5fcd28d..480ef82 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -137,57 +137,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define STABS_GCC_MARKER "gcc2_compiled." #endif -/* Typical USG systems don't have stab.h, and they also have - no use for DBX-format debugging info. */ - -#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) - -/* Nonzero if we have actually used any of the GDB extensions - to the debugging format. The idea is that we use them for the - first time only if there's a strong reason, but once we have done that, - we use them whenever convenient. */ - -static int have_used_extensions = 0; - -/* Number for the next N_SOL filename stabs label. The number 0 is reserved - for the N_SO filename stabs label. */ - -#if defined (DBX_DEBUGGING_INFO) && !defined (DBX_OUTPUT_SOURCE_FILENAME) -static int source_label_number = 1; -#endif - -#ifdef DEBUG_SYMS_TEXT -#define FORCE_TEXT function_section (current_function_decl); -#else -#define FORCE_TEXT -#endif - -#include "gstab.h" - -#define STAB_CODE_TYPE enum __stab_debug_code - -/* 1 if PARM is passed to this function in memory. */ - -#define PARM_PASSED_IN_MEMORY(PARM) \ - (GET_CODE (DECL_INCOMING_RTL (PARM)) == MEM) - -/* A C expression for the integer offset value of an automatic variable - (N_LSYM) having address X (an RTX). */ -#ifndef DEBUGGER_AUTO_OFFSET -#define DEBUGGER_AUTO_OFFSET(X) \ - (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) -#endif - -/* A C expression for the integer offset value of an argument (N_PSYM) - having address X (an RTX). The nominal offset is OFFSET. */ -#ifndef DEBUGGER_ARG_OFFSET -#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET) -#endif - -/* Stream for writing to assembler file. */ - -static FILE *asmfile; - /* Last source file name mentioned in a NOTE insn. */ static const char *lastfile; @@ -205,13 +154,11 @@ enum typestatus {TYPE_UNSEEN, TYPE_XREF, TYPE_DEFINED}; The file_number and type_number elements are used if DBX_USE_BINCL is defined. */ -struct typeinfo +struct typeinfo GTY(()) { enum typestatus status; -#ifdef DBX_USE_BINCL int file_number; int type_number; -#endif }; /* Vector recording information about C data types. @@ -219,25 +166,23 @@ struct typeinfo we assign it a number using next_type_number. That is its index in this vector. */ -struct typeinfo *typevec; +static GTY ((length ("typevec_len"))) struct typeinfo *typevec; /* Number of elements of space allocated in `typevec'. */ -static int typevec_len; +static GTY(()) int typevec_len; /* In dbx output, each type gets a unique number. This is the number for the next type output. The number, once assigned, is in the TYPE_SYMTAB_ADDRESS field. */ -static int next_type_number; - -#ifdef DBX_USE_BINCL +static GTY(()) int next_type_number; /* When using N_BINCL in dbx output, each type number is actually a pair of the file number and the type number within the file. This is a stack of input files. */ -struct dbx_file +struct dbx_file GTY(()) { struct dbx_file *next; int file_number; @@ -246,13 +191,62 @@ struct dbx_file /* This is the top of the stack. */ -static struct dbx_file *current_file; +static GTY(()) struct dbx_file *current_file; /* This is the next file number to use. */ -static int next_file_number; +static GTY(()) int next_file_number; + +/* Typical USG systems don't have stab.h, and they also have + no use for DBX-format debugging info. */ + +#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) + +/* Nonzero if we have actually used any of the GDB extensions + to the debugging format. The idea is that we use them for the + first time only if there's a strong reason, but once we have done that, + we use them whenever convenient. */ + +static int have_used_extensions = 0; + +/* Number for the next N_SOL filename stabs label. The number 0 is reserved + for the N_SO filename stabs label. */ + +#if defined (DBX_DEBUGGING_INFO) && !defined (DBX_OUTPUT_SOURCE_FILENAME) +static int source_label_number = 1; +#endif + +#ifdef DEBUG_SYMS_TEXT +#define FORCE_TEXT function_section (current_function_decl); +#else +#define FORCE_TEXT +#endif + +#include "gstab.h" + +#define STAB_CODE_TYPE enum __stab_debug_code + +/* 1 if PARM is passed to this function in memory. */ + +#define PARM_PASSED_IN_MEMORY(PARM) \ + (GET_CODE (DECL_INCOMING_RTL (PARM)) == MEM) -#endif /* DBX_USE_BINCL */ +/* A C expression for the integer offset value of an automatic variable + (N_LSYM) having address X (an RTX). */ +#ifndef DEBUGGER_AUTO_OFFSET +#define DEBUGGER_AUTO_OFFSET(X) \ + (GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) +#endif + +/* A C expression for the integer offset value of an argument (N_PSYM) + having address X (an RTX). The nominal offset is OFFSET. */ +#ifndef DEBUGGER_ARG_OFFSET +#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET) +#endif + +/* Stream for writing to assembler file. */ + +static FILE *asmfile; /* These variables are for dbxout_symbol to communicate to dbxout_finish_symbol. @@ -425,7 +419,7 @@ dbxout_init (input_file_name) asmfile = asm_out_file; typevec_len = 100; - typevec = (struct typeinfo *) xcalloc (typevec_len, sizeof typevec[0]); + typevec = (struct typeinfo *) ggc_calloc (typevec_len, sizeof typevec[0]); /* Convert Ltext into the appropriate format for local labels in case the system doesn't insert underscores in front of user generated @@ -484,7 +478,7 @@ dbxout_init (input_file_name) next_type_number = 1; #ifdef DBX_USE_BINCL - current_file = (struct dbx_file *) xmalloc (sizeof *current_file); + current_file = (struct dbx_file *) ggc_alloc (sizeof *current_file); current_file->next = NULL; current_file->file_number = 0; current_file->next_type_number = 1; @@ -541,7 +535,7 @@ dbxout_start_source_file (line, filename) const char *filename ATTRIBUTE_UNUSED; { #ifdef DBX_USE_BINCL - struct dbx_file *n = (struct dbx_file *) xmalloc (sizeof *n); + struct dbx_file *n = (struct dbx_file *) ggc_alloc (sizeof *n); n->next = current_file; n->file_number = next_file_number++; @@ -560,12 +554,8 @@ dbxout_end_source_file (line) unsigned int line ATTRIBUTE_UNUSED; { #ifdef DBX_USE_BINCL - struct dbx_file *next; - fprintf (asmfile, "%s%d,0,0,0\n", ASM_STABN_OP, N_EINCL); - next = current_file->next; - free (current_file); - current_file = next; + current_file = current_file->next; #endif } @@ -1149,8 +1139,9 @@ dbxout_type (type, full) if (next_type_number == typevec_len) { typevec - = (struct typeinfo *) xrealloc (typevec, - typevec_len * 2 * sizeof typevec[0]); + = (struct typeinfo *) ggc_realloc (typevec, + (typevec_len * 2 + * sizeof typevec[0])); memset ((char *) (typevec + typevec_len), 0, typevec_len * sizeof typevec[0]); typevec_len *= 2; @@ -3008,3 +2999,5 @@ dbxout_begin_function (decl) #endif /* DBX_DEBUGGING_INFO */ #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */ + +#include "gt-dbxout.h" |