summaryrefslogtreecommitdiff
path: root/gcc/dwarfout.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 20:51:46 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 20:51:46 +0000
commitc140b9445b045f733932e632775a4ef2a9c967a0 (patch)
tree8208475fab02ce7a5ccefba302810842e545181a /gcc/dwarfout.c
parentab6ab77eb56d4b512c625b36f4c4335d216fe19f (diff)
downloadgcc-c140b9445b045f733932e632775a4ef2a9c967a0.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarfout.c')
-rw-r--r--gcc/dwarfout.c50
1 files changed, 40 insertions, 10 deletions
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);