aboutsummaryrefslogtreecommitdiff
path: root/gcc/xcoffout.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2004-10-27 01:29:42 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-10-27 01:29:42 +0000
commit93a27b7badb18e8a13cfc877c8c74e88ecc44774 (patch)
tree0c96f65f534d94db49923bd04453180f46fc5a5a /gcc/xcoffout.h
parentab4375af84fb7780d3a4c7f7a25521341931cf0c (diff)
downloadgcc-93a27b7badb18e8a13cfc877c8c74e88ecc44774.zip
gcc-93a27b7badb18e8a13cfc877c8c74e88ecc44774.tar.gz
gcc-93a27b7badb18e8a13cfc877c8c74e88ecc44774.tar.bz2
dbxout.c: Include obstack.h.
* dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
Diffstat (limited to 'gcc/xcoffout.h')
-rw-r--r--gcc/xcoffout.h65
1 files changed, 30 insertions, 35 deletions
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index 597d8e1..59a0d3a 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -21,8 +21,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#define ASM_STABS_OP "\t.stabx\t"
-
/* Tags and typedefs are C_DECL in XCOFF, not C_LSYM. */
#define DBX_TYPE_DECL_STABS_CODE N_DECL
@@ -70,32 +68,35 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Define our own finish symbol function, since xcoff stabs have their
own different format. */
-#define DBX_FINISH_SYMBOL(ASMFILE,SYM) \
-{ \
- if (current_sym_addr && current_sym_code == N_FUN) \
- fprintf ((ASMFILE), "\",."); \
- else \
- fprintf ((ASMFILE), "\","); \
- /* If we are writing a function name, we must ensure that \
- there is no storage-class suffix on the name. */ \
- if (current_sym_addr && current_sym_code == N_FUN \
- && GET_CODE (current_sym_addr) == SYMBOL_REF) \
+#define DBX_FINISH_STABS(CODE, LINE, ADDR, LABEL, NUMBER) do { \
+ if (ADDR) \
{ \
- const char *_p = XSTR (current_sym_addr, 0); \
- if (*_p == '*') \
- fprintf ((ASMFILE), "%s", _p+1); \
+ /* If we are writing a function name, we must ensure that \
+ there is no storage-class suffix on the name. */ \
+ if (CODE == N_FUN && GET_CODE (ADDR) == SYMBOL_REF) \
+ { \
+ const char *_p = XSTR (ADDR, 0); \
+ if (*_p == '*') \
+ fputs (_p+1, asm_out_file); \
+ else \
+ for (; *_p != '[' && *_p; _p++) \
+ putc (*_p, asm_out_file); \
+ } \
else \
- for (; *_p != '[' && *_p; _p++) \
- fprintf ((ASMFILE), "%c", *_p); \
+ { \
+ if (CODE == N_FUN) \
+ putc ('.', asm_out_file); \
+ output_addr_const (asm_out_file, ADDR); \
+ } \
} \
- else if (current_sym_addr) \
- output_addr_const ((ASMFILE), current_sym_addr); \
- else if (current_sym_code == N_GSYM) \
- assemble_name ((ASMFILE), XSTR (XEXP (DECL_RTL (SYM), 0), 0)); \
+ else if (LABEL) \
+ assemble_name (asm_out_file, LABEL); \
else \
- fprintf ((ASMFILE), "%d", current_sym_value); \
- fprintf ((ASMFILE), ",%d,0\n", stab_to_sclass (current_sym_code)); \
-}
+ dbxout_int (NUMBER); \
+ putc (',', asm_out_file); \
+ dbxout_int (stab_to_sclass (CODE)); \
+ fputs (",0\n", asm_out_file); \
+} while (0)
/* These are IBM XCOFF extensions we need to reference in dbxout.c
and xcoffout.c. */
@@ -128,7 +129,7 @@ extern char *xcoff_read_only_section_name;
extern const char *xcoff_lastfile;
/* Don't write out path name for main source file. */
-#define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE,FILENAME)
+#define NO_DBX_MAIN_SOURCE_DIRECTORY 1
/* Write out main source file name using ".file" rather than ".stabs".
We don't actually do this here, because the assembler gets confused if there
@@ -140,7 +141,7 @@ extern const char *xcoff_lastfile;
/* If we are still in an include file, its end must be marked. */
#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
-{ \
+do { \
if (xcoff_current_include_file) \
{ \
fputs ("\t.ei\t", (FILE)); \
@@ -148,16 +149,10 @@ extern const char *xcoff_lastfile;
putc ('\n', (FILE)); \
xcoff_current_include_file = NULL; \
} \
-}
+} while (0)
-/* .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\"gcc2_compiled.\",0,%d,0\n", ASM_STABS_OP, \
- stab_to_sclass (N_GSYM))
-#else
-#define DBX_OUTPUT_GCC_MARKER(FILE)
-#endif
+/* Do not emit any marker for XCOFF until assembler allows XFT_CV. */
+#define NO_DBX_GCC_MARKER
/* Do not break .stabs pseudos into continuations. */
#define DBX_CONTIN_LENGTH 0