From 7f905405bc326d31fe7c0b51f435f29cd063ae9f Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Wed, 11 Jul 2001 20:51:46 +0000 Subject: [PATCH] Makefile.in (c-lex.o): Wrap long lines. * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug hooks directly. * dbxout.c (dbx_debug_hooks): Add new hooks. (dbxout_start_new_source_file): Rename dbxout_start_source_file, make static. (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, make static. * dbxout.h (dbxout_start_new_source_file, dbxout_resume_previous_source_file): Delete. * debug.c (do_nothing_debug_hooks): Add new hooks. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * debug.h (gcc_debug_hooks): New hooks define, undef, start_source_file and end_source_file. (debug_nothing_init_finish): Rename debug_nothing_file_charstar. (debug_nothing_int_charstar, debug_nothing_int): New. * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Make static. * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_define, dwarf2out_undef): Remove. * dwarfout.c (dwarf_debug_hooks): Add new hooks. (dwarfout_start_source_file, dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Make static. (dwarfout_start_source_file_check, dwarfout_end_source_file_check): New. (dwarfout_define, dwarfout_finish): Update. * dwarfout.h (dwarfout_start_new_source_file, dwarfout_resume_previous_source_file, dwarfout_define, dwarfout_undef): Remove. * sdbout.c (sdb_debug_hooks): Add new hooks. (sdbout_start_new_source_file): Rename sdbout_start_source_file, make static. (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, make static, take an arg. * sdbout.h (sdbout_start_new_source_file, sdbout_resume_previous_source_file): Delete. * toplev.c (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * toplev.h (debug_start_source_file, debug_end_source_file, debug_define, debug_undef): Delete. * java/jcf-parse.c: Include debug.h. (parse_class_file): Update to use debug hooks directly. * java/Make-lang.in (jcf-parse.o): Depend on debug.h. From-SVN: r43952 --- gcc/ChangeLog | 50 ++++++++++++++++++++++++ gcc/Makefile.in | 3 +- gcc/c-lex.c | 13 ++++--- gcc/dbxout.c | 20 +++++++--- gcc/dbxout.h | 3 -- gcc/debug.c | 23 +++++++++-- gcc/debug.h | 21 +++++++++- gcc/dwarf2out.c | 60 +++++++++++++--------------- gcc/dwarf2out.h | 5 --- gcc/dwarfout.c | 50 +++++++++++++++++++----- gcc/dwarfout.h | 4 -- gcc/f/Make-lang.in | 2 +- gcc/f/lex.c | 28 ++++--------- gcc/java/Make-lang.in | 3 +- gcc/java/jcf-parse.c | 5 ++- gcc/sdbout.c | 20 +++++++--- gcc/sdbout.h | 2 - gcc/toplev.c | 91 +------------------------------------------ gcc/toplev.h | 4 -- 19 files changed, 210 insertions(+), 197 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e8f49130d4..52d9a3383e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,53 @@ +2001-07-11 Neil Booth + + * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. + * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug + hooks directly. + * dbxout.c (dbx_debug_hooks): Add new hooks. + (dbxout_start_new_source_file): Rename dbxout_start_source_file, + make static. + (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, + make static. + * dbxout.h (dbxout_start_new_source_file, + dbxout_resume_previous_source_file): Delete. + * debug.c (do_nothing_debug_hooks): Add new hooks. + (debug_nothing_init_finish): Rename debug_nothing_file_charstar. + (debug_nothing_int_charstar, debug_nothing_int): New. + * debug.h (gcc_debug_hooks): New hooks define, undef, + start_source_file and end_source_file. + (debug_nothing_init_finish): Rename debug_nothing_file_charstar. + (debug_nothing_int_charstar, debug_nothing_int): New. + * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. Move into + the conditionally compiled section. + (dwarf2out_start_source_file, dwarf2out_end_source_file, + dwarf2out_define, dwarf2out_undef): Make static. + * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, + dwarf2out_define, dwarf2out_undef): Remove. + * dwarfout.c (dwarf_debug_hooks): Add new hooks. + (dwarfout_start_source_file, dwarfout_end_source_file, + dwarfout_define, dwarfout_undef): Make static. + (dwarfout_start_source_file_check, + dwarfout_end_source_file_check): New. + (dwarfout_define, dwarfout_finish): Update. + * dwarfout.h (dwarfout_start_new_source_file, + dwarfout_resume_previous_source_file, dwarfout_define, + dwarfout_undef): Remove. + * sdbout.c (sdb_debug_hooks): Add new hooks. + (sdbout_start_new_source_file): Rename sdbout_start_source_file, + make static. + (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, + make static, take an arg. + * sdbout.h (sdbout_start_new_source_file, + sdbout_resume_previous_source_file): Delete. + * toplev.c (debug_start_source_file, debug_end_source_file, + debug_define, debug_undef): Delete. + * toplev.h (debug_start_source_file, debug_end_source_file, + debug_define, debug_undef): Delete. + + * java/jcf-parse.c: Include debug.h. + (parse_class_file): Update to use debug hooks directly. + * java/Make-lang.in (jcf-parse.o): Depend on debug.h. + Wed Jul 11 10:07:18 2001 Richard Kenner * alias.c (set_mem_alias_set): New function. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 9bd5dc8089c..beb097ce275 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1162,7 +1162,8 @@ c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \ c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \ $(GGC_H) c-lex.h toplev.h diagnostic.h output.h function.h \ $(RTL_H) $(EXPR_H) -c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) c-lex.h $(C_TREE_H) \ +c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) c-lex.h \ + debug.h $(C_TREE_H) \ c-pragma.h input.h intl.h flags.h toplev.h output.h \ mbchar.h cpplib.h $(EXPR_H) $(TM_P_H) c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \ diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 714de0c807f..02c85a0e5ec 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */ #include "intl.h" #include "tm_p.h" #include "splay-tree.h" +#include "debug.h" /* MULTIBYTE_CHARS support only works for native compilers. ??? Ideally what we want is to model widechar support after @@ -249,7 +250,7 @@ cb_file_change (pfile, fc) lineno = fc->from.lineno; push_srcloc (fc->to.filename, 1); input_file_stack->indent_level = indent_level; - debug_start_source_file (fc->from.lineno, fc->to.filename); + (*debug_hooks->start_source_file) (fc->from.lineno, fc->to.filename); #ifndef NO_IMPLICIT_EXTERN_C if (c_header_level) ++c_header_level; @@ -287,7 +288,7 @@ cb_file_change (pfile, fc) } #endif pop_srcloc (); - debug_end_source_file (input_file_stack->line); + (*debug_hooks->end_source_file) (input_file_stack->line); } else error ("leaving more files than we entered"); @@ -334,16 +335,18 @@ cb_define (pfile, node) cpp_reader *pfile; cpp_hashnode *node; { - debug_define (cpp_get_line (parse_in)->line, (const char *) cpp_macro_definition (pfile, node)); + (*debug_hooks->define) (cpp_get_line (pfile)->line, + (const char *) cpp_macro_definition (pfile, node)); } /* #undef callback for DWARF and DWARF2 debug info. */ static void cb_undef (pfile, node) - cpp_reader *pfile ATTRIBUTE_UNUSED; + cpp_reader *pfile; cpp_hashnode *node; { - debug_undef (cpp_get_line (parse_in)->line, (const char *) NODE_NAME (node)); + (*debug_hooks->undef) (cpp_get_line (pfile)->line, + (const char *) NODE_NAME (node)); } #if 0 /* not yet */ diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 0dd135ba0de..2a16e4dd8d9 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -286,6 +286,8 @@ static int current_sym_nchars; static void dbxout_init PARAMS ((FILE *, const char *)); static void dbxout_finish PARAMS ((FILE *, const char *)); +static void dbxout_start_source_file PARAMS ((unsigned, const char *)); +static void dbxout_end_source_file PARAMS ((unsigned)); #if defined(ASM_OUTPUT_SECTION_NAME) static void dbxout_function_end PARAMS ((void)); #endif @@ -309,11 +311,15 @@ static void dbxout_finish_symbol PARAMS ((tree)); static void dbxout_block PARAMS ((tree, int, tree)); static void dbxout_really_begin_function PARAMS ((tree)); -/* The target debug structure. */ +/* The debug hooks structure. */ struct gcc_debug_hooks dbx_debug_hooks = { dbxout_init, - dbxout_finish + dbxout_finish, + debug_nothing_int_charstar, + debug_nothing_int_charstar, + dbxout_start_source_file, + dbxout_end_source_file }; #if defined(ASM_OUTPUT_SECTION_NAME) @@ -460,8 +466,9 @@ dbxout_typedefs (syms) /* Change to reading from a new source file. Generate a N_BINCL stab. */ -void -dbxout_start_new_source_file (filename) +static void +dbxout_start_source_file (line, filename) + unsigned int line ATTRIBUTE_UNUSED; const char *filename ATTRIBUTE_UNUSED; { #ifdef DBX_USE_BINCL @@ -479,8 +486,9 @@ dbxout_start_new_source_file (filename) /* Revert to reading a previous source file. Generate a N_EINCL stab. */ -void -dbxout_resume_previous_source_file () +static void +dbxout_end_source_file (line) + unsigned int line ATTRIBUTE_UNUSED; { #ifdef DBX_USE_BINCL struct dbx_file *next; diff --git a/gcc/dbxout.h b/gcc/dbxout.h index a42a261951b..3bdc7956423 100644 --- a/gcc/dbxout.h +++ b/gcc/dbxout.h @@ -18,9 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void dbxout_start_new_source_file PARAMS ((const char *)); -extern void dbxout_resume_previous_source_file PARAMS ((void)); - extern void dbxout_source_file PARAMS ((FILE *, const char *)); extern void dbxout_types PARAMS ((tree)); extern void dbxout_args PARAMS ((tree)); diff --git a/gcc/debug.c b/gcc/debug.c index 9d6e880a037..0b750ac7870 100644 --- a/gcc/debug.c +++ b/gcc/debug.c @@ -22,16 +22,33 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The do-nothing debug hooks. */ struct gcc_debug_hooks do_nothing_debug_hooks = { - debug_nothing_init_finish, - debug_nothing_init_finish + debug_nothing_file_charstar, + debug_nothing_file_charstar, + debug_nothing_int_charstar, + debug_nothing_int_charstar, + debug_nothing_int_charstar, + debug_nothing_int }; /* This file contains implementations of each debug hook that do nothing. */ void -debug_nothing_init_finish (file, main_filename) +debug_nothing_file_charstar (file, main_filename) FILE *file ATTRIBUTE_UNUSED; const char *main_filename ATTRIBUTE_UNUSED; { } + +void +debug_nothing_int_charstar (line, text) + unsigned int line ATTRIBUTE_UNUSED; + const char *text ATTRIBUTE_UNUSED; +{ +} + +void +debug_nothing_int (line) + unsigned int line ATTRIBUTE_UNUSED; +{ +} diff --git a/gcc/debug.h b/gcc/debug.h index 86dc5d597c1..9b7e28a5958 100644 --- a/gcc/debug.h +++ b/gcc/debug.h @@ -29,14 +29,33 @@ struct gcc_debug_hooks /* Output debug symbols to FILE. */ void (* finish) PARAMS ((FILE * file, const char *main_filename)); + + /* Macro defined on line LINE with name and expansion TEXT. */ + void (* define) PARAMS ((unsigned int line, const char *text)); + + /* MACRO undefined on line LINE. */ + void (* undef) PARAMS ((unsigned int line, const char *macro)); + + /* Record the beginning of a new source file FILE from LINE number + in the previous one. */ + void (* start_source_file) PARAMS ((unsigned int line, const char *file)); + + /* Record the resumption of a source file. LINE is the line number + in the source file we are returning to. */ + void (* end_source_file) PARAMS ((unsigned int line)); }; extern struct gcc_debug_hooks *debug_hooks; /* The do-nothing hooks. */ -extern void debug_nothing_init_finish +extern void debug_nothing_file_charstar PARAMS ((FILE *, const char *)); +extern void debug_nothing_int_charstar + PARAMS ((unsigned int, const char *)); +extern void debug_nothing_int + PARAMS ((unsigned int)); +/* Hooks for various debug formats. */ extern struct gcc_debug_hooks do_nothing_debug_hooks; extern struct gcc_debug_hooks dbx_debug_hooks; extern struct gcc_debug_hooks sdb_debug_hooks; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 09a9e52dfbd..dc8d64a090a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -232,8 +232,6 @@ static unsigned current_funcdef_fde; /* Forward declarations for functions defined in this file. */ -static void dwarf2out_init PARAMS ((FILE *, const char *)); -static void dwarf2out_finish PARAMS ((FILE *, const char *)); static char *stripattributes PARAMS ((const char *)); static const char *dwarf_cfi_name PARAMS ((unsigned)); static dw_cfi_ref new_cfi PARAMS ((void)); @@ -364,12 +362,6 @@ expand_builtin_dwarf_fp_regnum () #define INCOMING_FRAME_SP_OFFSET 0 #endif -/* The target debug structure. */ - -struct gcc_debug_hooks dwarf2_debug_hooks - = {dwarf2out_init, dwarf2out_finish -}; - /* Return a pointer to a copy of the section string name S with all attributes stripped off, and an asterisk prepended (for assemble_name). */ @@ -3009,6 +3001,25 @@ get_cfa_from_loc_descr (cfa, loc) /* And now, the support for symbolic debugging information. */ #ifdef DWARF2_DEBUGGING_INFO +static void dwarf2out_init PARAMS ((FILE *, const char *)); +static void dwarf2out_finish PARAMS ((FILE *, const char *)); +static void dwarf2out_define PARAMS ((unsigned int, const char *)); +static void dwarf2out_undef PARAMS ((unsigned int, const char *)); +static void dwarf2out_start_source_file PARAMS ((unsigned, const char *)); +static void dwarf2out_end_source_file PARAMS ((unsigned)); + +/* The debug hooks structure. */ + +struct gcc_debug_hooks dwarf2_debug_hooks = +{ + dwarf2out_init, + dwarf2out_finish, + dwarf2out_define, + dwarf2out_undef, + dwarf2out_start_source_file, + dwarf2out_end_source_file +}; + /* NOTE: In the comments in this file, many references are made to "Debugging Information Entries". This term is abbreviated as `DIE' throughout the remainder of this file. */ @@ -11283,10 +11294,10 @@ dwarf2out_line (filename, line) /* Record the beginning of a new source file. */ -void +static void dwarf2out_start_source_file (lineno, filename) - register unsigned int lineno ATTRIBUTE_UNUSED; - register const char *filename ATTRIBUTE_UNUSED; + register unsigned int lineno; + register const char *filename; { if (flag_eliminate_dwarf2_dups) { @@ -11305,8 +11316,9 @@ dwarf2out_start_source_file (lineno, filename) /* Record the end of a source file. */ -void -dwarf2out_end_source_file () +static void +dwarf2out_end_source_file (lineno) + unsigned int lineno ATTRIBUTE_UNUSED; { if (flag_eliminate_dwarf2_dups) { @@ -11324,7 +11336,7 @@ dwarf2out_end_source_file () the tail part of the directive line, i.e. the part which is past the initial whitespace, #, whitespace, directive-name, whitespace part. */ -void +static void dwarf2out_define (lineno, buffer) register unsigned lineno ATTRIBUTE_UNUSED; register const char *buffer ATTRIBUTE_UNUSED; @@ -11348,7 +11360,7 @@ dwarf2out_define (lineno, buffer) the tail part of the directive line, i.e. the part which is past the initial whitespace, #, whitespace, directive-name, whitespace part. */ -void +static void dwarf2out_undef (lineno, buffer) register unsigned lineno ATTRIBUTE_UNUSED; register const char *buffer ATTRIBUTE_UNUSED; @@ -11587,22 +11599,4 @@ dwarf2out_finish (asm_out_file, input_filename) } } -#else /* DWARF2_DEBUGGING_INFO - -/* Use dummy versions of init and finish routines. */ - -static void -dwarf2out_init (asm_out_file, main_input_filename) - register FILE *asm_out_file ATTRIBUTE_UNUSED; - register const char *main_input_filename ATTRIBUTE_UNUSED; -{ -} - -static void -dwarf2out_finish (asm_out_file, input_filename) - register FILE *asm_out_file ATTRIBUTE_UNUSED; - register const char *input_filename ATTRIBUTE_UNUSED; -{ -} - #endif /* DWARF2_DEBUGGING_INFO */ diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index f429c960c5e..726ad0061a6 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -18,11 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void dwarf2out_define PARAMS ((unsigned, const char *)); -extern void dwarf2out_undef PARAMS ((unsigned, const char *)); -extern void dwarf2out_start_source_file PARAMS ((unsigned, const char *)); -extern void dwarf2out_end_source_file PARAMS ((void)); - extern void dwarf2out_begin_block PARAMS ((unsigned)); extern void dwarf2out_end_block PARAMS ((unsigned)); extern int dwarf2out_ignore_block PARAMS ((tree)); diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 83c95a0593b..f5fa7c424e5 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -789,6 +789,12 @@ static int in_class; static void dwarfout_init PARAMS ((FILE *, const char *)); static void dwarfout_finish PARAMS ((FILE *, const char *)); +static void dwarfout_define PARAMS ((unsigned int, const char *)); +static void dwarfout_undef PARAMS ((unsigned int, const char *)); +static void dwarfout_start_source_file PARAMS ((unsigned, const char *)); +static void dwarfout_start_source_file_check PARAMS ((unsigned, const char *)); +static void dwarfout_end_source_file PARAMS ((unsigned)); +static void dwarfout_end_source_file_check PARAMS ((unsigned)); static const char *dwarf_tag_name PARAMS ((unsigned)); static const char *dwarf_attr_name PARAMS ((unsigned)); static const char *dwarf_stack_op_name PARAMS ((unsigned)); @@ -1361,11 +1367,15 @@ static void retry_incomplete_types PARAMS ((void)); #endif -/* The target debug structure. */ +/* The debug hooks structure. */ struct gcc_debug_hooks dwarf_debug_hooks = { dwarfout_init, - dwarfout_finish + dwarfout_finish, + dwarfout_define, + dwarfout_undef, + dwarfout_start_source_file_check, + dwarfout_end_source_file_check }; /************************ general utility functions **************************/ @@ -6107,8 +6117,19 @@ generate_macinfo_entry (type_and_offset, string) ASM_OUTPUT_POP_SECTION (asm_out_file); } -void -dwarfout_start_new_source_file (filename) +/* Wrapper for toplev.c callback to check debug info level. */ +static void +dwarfout_start_source_file_check (line, filename) + unsigned int line; + register const char *filename; +{ + if (debug_info_level == DINFO_LEVEL_VERBOSE) + dwarfout_start_source_file (line, filename); +} + +static void +dwarfout_start_source_file (line, filename) + unsigned int line ATTRIBUTE_UNUSED; register const char *filename; { char label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -6123,8 +6144,17 @@ dwarfout_start_new_source_file (filename) generate_macinfo_entry (type_and_offset, ""); } -void -dwarfout_resume_previous_source_file (lineno) +/* Wrapper for toplev.c callback to check debug info level. */ +static void +dwarfout_end_source_file_check (lineno) + register unsigned lineno; +{ + if (debug_info_level == DINFO_LEVEL_VERBOSE) + dwarfout_end_source_file (lineno); +} + +static void +dwarfout_end_source_file (lineno) register unsigned lineno; { char type_and_offset[MAX_ARTIFICIAL_LABEL_BYTES*2]; @@ -6139,7 +6169,7 @@ dwarfout_resume_previous_source_file (lineno) is past the initial whitespace, #, whitespace, directive-name, whitespace part. */ -void +static void dwarfout_define (lineno, buffer) register unsigned lineno; register const char *buffer; @@ -6149,7 +6179,7 @@ dwarfout_define (lineno, buffer) if (!initialized) { - dwarfout_start_new_source_file (primary_filename); + dwarfout_start_source_file (0, primary_filename); initialized = 1; } sprintf (type_and_offset, "0x%08x+%u", @@ -6162,7 +6192,7 @@ dwarfout_define (lineno, buffer) is past the initial whitespace, #, whitespace, directive-name, whitespace part. */ -void +static void dwarfout_undef (lineno, buffer) register unsigned lineno; register const char *buffer; @@ -6487,7 +6517,7 @@ dwarfout_finish (asm_out_file, main_input_filename) { /* Output terminating entries for the .debug_macinfo section. */ - dwarfout_resume_previous_source_file (0); + dwarfout_end_source_file (0); fputc ('\n', asm_out_file); ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); diff --git a/gcc/dwarfout.h b/gcc/dwarfout.h index cbe6c00a09a..a72db0515cd 100644 --- a/gcc/dwarfout.h +++ b/gcc/dwarfout.h @@ -18,11 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void dwarfout_define PARAMS ((unsigned, const char *)); -extern void dwarfout_undef PARAMS ((unsigned, const char *)); extern void dwarfout_file_scope_decl PARAMS ((tree , int)); -extern void dwarfout_start_new_source_file PARAMS ((const char *)); -extern void dwarfout_resume_previous_source_file PARAMS ((unsigned)); extern void dwarfout_begin_function PARAMS ((void)); extern void dwarfout_end_function PARAMS ((void)); diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in index 69d6e17c13c..df0a4d13779 100644 --- a/gcc/f/Make-lang.in +++ b/gcc/f/Make-lang.in @@ -467,7 +467,7 @@ f/lex.o: f/lex.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/top.h f/malloc.h f/where.h \ f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def \ f/target.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \ f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h f/src.h flags.h \ - input.h toplev.h output.h $(GGC_H) + debug.h input.h toplev.h output.h $(GGC_H) f/malloc.o: f/malloc.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/malloc.h f/name.o: f/name.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bad.h f/bad.def f/where.h \ glimits.h f/top.h f/malloc.h f/name.h f/global.h f/info.h f/info-b.def \ diff --git a/gcc/f/lex.c b/gcc/f/lex.c index d5aaa1589ed..70f666aaf44 100644 --- a/gcc/f/lex.c +++ b/gcc/f/lex.c @@ -26,6 +26,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "lex.h" #include "malloc.h" #include "src.h" +#include "debug.h" #if FFECOM_targetCURRENT == FFECOM_targetGCC #include "flags.h" #include "input.h" @@ -34,10 +35,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" #endif -#ifdef DWARF_DEBUGGING_INFO -#include "dwarfout.h" -#endif - static void ffelex_append_to_token_ (char c); static int ffelex_backslash_ (int c, ffewhereColumnNumber col); static void ffelex_bad_1_ (ffebad errnum, ffewhereLineNumber ln0, @@ -860,11 +857,8 @@ ffelex_file_pop_ (const char *input_filename) input_file_stack = p->next; free (p); input_file_stack_tick++; -#ifdef DWARF_DEBUGGING_INFO - if (debug_info_level == DINFO_LEVEL_VERBOSE - && write_symbols == DWARF_DEBUG) - dwarfout_resume_previous_source_file (input_file_stack->line); -#endif /* DWARF_DEBUGGING_INFO */ + if (write_symbols == DWARF_DEBUG) + (*debug_hooks->end_source_file) (input_file_stack->line); } else error ("#-lines for entering and leaving files don't match"); @@ -888,11 +882,9 @@ ffelex_file_push_ (int old_lineno, const char *input_filename) p->name = input_filename; input_file_stack = p; input_file_stack_tick++; -#ifdef DWARF_DEBUGGING_INFO - if (debug_info_level == DINFO_LEVEL_VERBOSE - && write_symbols == DWARF_DEBUG) - dwarfout_start_new_source_file (input_filename); -#endif /* DWARF_DEBUGGING_INFO */ + + if (write_symbols == DWARF_DEBUG) + (*debug_hooks->start_source_file) (0, input_filename); /* Now that we've pushed or popped the input stack, update the name in the top element. */ @@ -1173,11 +1165,9 @@ ffelex_hash_ (FILE *finput) c = ffelex_get_directive_line_ (&text, finput); -#ifdef DWARF_DEBUGGING_INFO if ((debug_info_level == DINFO_LEVEL_VERBOSE) && (write_symbols == DWARF_DEBUG)) - dwarfout_define (lineno, text); -#endif /* DWARF_DEBUGGING_INFO */ + (*debug_hooks->define) (lineno, text); goto skipline; } @@ -1195,11 +1185,9 @@ ffelex_hash_ (FILE *finput) c = ffelex_get_directive_line_ (&text, finput); -#ifdef DWARF_DEBUGGING_INFO if ((debug_info_level == DINFO_LEVEL_VERBOSE) && (write_symbols == DWARF_DEBUG)) - dwarfout_undef (lineno, text); -#endif /* DWARF_DEBUGGING_INFO */ + (*debug_hooks->undef) (lineno, text); goto skipline; } diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index a7ec8cc60df..f1c00d7f938 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -259,7 +259,8 @@ java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(SYSTEM_H) $(GGC_H) java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \ - input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) + input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) \ + debug.h java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ $(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \ toplev.h $(GGC_H) diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index d925205fe19..c73d1dcf3b2 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -35,6 +35,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "toplev.h" #include "parse.h" #include "ggc.h" +#include "debug.h" #ifdef HAVE_LOCALE_H #include @@ -774,7 +775,7 @@ parse_class_file () input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class)); lineno = 0; - debug_start_source_file (lineno, input_filename); + (*debug_hooks->start_source_file) (lineno, input_filename); init_outgoing_cpool (); /* Currently we always have to emit calls to _Jv_InitClass when @@ -860,7 +861,7 @@ parse_class_file () finish_class (); - debug_end_source_file (save_lineno); + (*debug_hooks->end_source_file) (save_lineno); input_filename = save_input_filename; lineno = save_lineno; } diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 4bf324764ab..47d34c17a84 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -93,6 +93,8 @@ extern tree current_function_decl; #include "sdbout.h" static void sdbout_init PARAMS ((FILE *, const char *)); +static void sdbout_start_source_file PARAMS ((unsigned, const char *)); +static void sdbout_end_source_file PARAMS ((unsigned)); static char *gen_fake_label PARAMS ((void)); static int plain_type PARAMS ((tree)); static int template_name_p PARAMS ((tree)); @@ -289,11 +291,15 @@ static struct sdb_file *current_file; #endif /* MIPS_DEBUGGING_INFO */ -/* The target debug structure. */ +/* The debug hooks structure. */ struct gcc_debug_hooks sdb_debug_hooks = { sdbout_init, - debug_nothing_init_finish + debug_nothing_file_charstar, + debug_nothing_int_charstar, + debug_nothing_int_charstar, + sdbout_start_source_file, + sdbout_end_source_file }; #if 0 @@ -1584,8 +1590,9 @@ sdbout_label (insn) /* Change to reading from a new source file. */ -void -sdbout_start_new_source_file (filename) +static void +sdbout_start_source_file (line, filename) + unsigned int line ATTRIBUTE_UNUSED; const char *filename ATTRIBUTE_UNUSED; { #ifdef MIPS_DEBUGGING_INFO @@ -1600,8 +1607,9 @@ sdbout_start_new_source_file (filename) /* Revert to reading a previous source file. */ -void -sdbout_resume_previous_source_file () +static void +sdbout_end_source_file (line) + unsigned int line ATTRIBUTE_UNUSED; { #ifdef MIPS_DEBUGGING_INFO struct sdb_file *next; diff --git a/gcc/sdbout.h b/gcc/sdbout.h index 1fbb110b195..1697ffd91f3 100644 --- a/gcc/sdbout.h +++ b/gcc/sdbout.h @@ -31,7 +31,5 @@ extern void sdbout_types PARAMS ((tree)); extern void sdbout_end_epilogue PARAMS ((void)); -extern void sdbout_start_new_source_file PARAMS ((const char *)); -extern void sdbout_resume_previous_source_file PARAMS ((void)); extern void sdbout_mark_begin_function PARAMS ((void)); diff --git a/gcc/toplev.c b/gcc/toplev.c index 3bef83a30ec..c42a243ba51 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2412,6 +2412,7 @@ compile_file (name) /* Do dbx symbols. */ timevar_push (TV_SYMOUT); + #ifdef DWARF2_UNWIND_INFO if (dwarf2out_do_frame ()) dwarf2out_frame_finish (); @@ -5195,96 +5196,6 @@ print_switch_values (file, pos, max, indent, sep, term) fprintf (file, "%s", term); } -/* Record the beginning of a new source file, named FILENAME. */ - -void -debug_start_source_file (lineno, filename) - register unsigned int lineno ATTRIBUTE_UNUSED; - register const char *filename ATTRIBUTE_UNUSED; -{ -#ifdef DBX_DEBUGGING_INFO - if (write_symbols == DBX_DEBUG) - dbxout_start_new_source_file (filename); -#endif -#ifdef DWARF_DEBUGGING_INFO - if (debug_info_level == DINFO_LEVEL_VERBOSE - && write_symbols == DWARF_DEBUG) - dwarfout_start_new_source_file (filename); -#endif /* DWARF_DEBUGGING_INFO */ -#ifdef DWARF2_DEBUGGING_INFO - if (write_symbols == DWARF2_DEBUG) - dwarf2out_start_source_file (lineno, filename); -#endif /* DWARF2_DEBUGGING_INFO */ -#ifdef SDB_DEBUGGING_INFO - if (write_symbols == SDB_DEBUG) - sdbout_start_new_source_file (filename); -#endif -} - -/* Record the resumption of a source file. LINENO is the line number in - the source file we are returning to. */ - -void -debug_end_source_file (lineno) - register unsigned lineno ATTRIBUTE_UNUSED; -{ -#ifdef DBX_DEBUGGING_INFO - if (write_symbols == DBX_DEBUG) - dbxout_resume_previous_source_file (); -#endif -#ifdef DWARF_DEBUGGING_INFO - if (debug_info_level == DINFO_LEVEL_VERBOSE - && write_symbols == DWARF_DEBUG) - dwarfout_resume_previous_source_file (lineno); -#endif /* DWARF_DEBUGGING_INFO */ -#ifdef DWARF2_DEBUGGING_INFO - if (write_symbols == DWARF2_DEBUG) - dwarf2out_end_source_file (); -#endif /* DWARF2_DEBUGGING_INFO */ -#ifdef SDB_DEBUGGING_INFO - if (write_symbols == SDB_DEBUG) - sdbout_resume_previous_source_file (); -#endif -} - -/* Called from cb_define in c-lex.c. The `buffer' parameter contains - the tail part of the directive line, i.e. the part which is past the - initial whitespace, #, whitespace, directive-name, whitespace part. */ - -void -debug_define (lineno, buffer) - register unsigned lineno ATTRIBUTE_UNUSED; - register const char *buffer ATTRIBUTE_UNUSED; -{ -#ifdef DWARF_DEBUGGING_INFO - if (write_symbols == DWARF_DEBUG) - dwarfout_define (lineno, buffer); -#endif /* DWARF_DEBUGGING_INFO */ -#ifdef DWARF2_DEBUGGING_INFO - if (write_symbols == DWARF2_DEBUG) - dwarf2out_define (lineno, buffer); -#endif /* DWARF2_DEBUGGING_INFO */ -} - -/* Called from cb_undef in c-lex.c. The `buffer' parameter contains - the tail part of the directive line, i.e. the part which is past the - initial whitespace, #, whitespace, directive-name, whitespace part. */ - -void -debug_undef (lineno, buffer) - register unsigned lineno ATTRIBUTE_UNUSED; - register const char *buffer ATTRIBUTE_UNUSED; -{ -#ifdef DWARF_DEBUGGING_INFO - if (write_symbols == DWARF_DEBUG) - dwarfout_undef (lineno, buffer); -#endif /* DWARF_DEBUGGING_INFO */ -#ifdef DWARF2_DEBUGGING_INFO - if (write_symbols == DWARF2_DEBUG) - dwarf2out_undef (lineno, buffer); -#endif /* DWARF2_DEBUGGING_INFO */ -} - /* Returns nonzero if it is appropriate not to emit any debugging information for BLOCK, because it doesn't contain any instructions. This may not be the case for blocks containing nested functions, since diff --git a/gcc/toplev.h b/gcc/toplev.h index a9ea1258bff..0797b2d95ad 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -37,10 +37,6 @@ extern int read_integral_parameter PARAMS ((const char *, const char *, extern int count_error PARAMS ((int)); extern void strip_off_ending PARAMS ((char *, int)); extern void print_time PARAMS ((const char *, long)); -extern void debug_start_source_file PARAMS ((unsigned, const char *)); -extern void debug_end_source_file PARAMS ((unsigned)); -extern void debug_define PARAMS ((unsigned, const char *)); -extern void debug_undef PARAMS ((unsigned, const char *)); extern int debug_ignore_block PARAMS ((union tree_node *)); extern const char *trim_filename PARAMS ((const char *)); extern void internal_error PARAMS ((const char *, ...)) -- 2.30.2