dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue.

* dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue.
	(xcoff_debug_hooks): Update end_prologue.
	* debug.c (do_nothing_debug_hooks): Update end_prologue, end_epilogue.
	* debug.h (end_prologue): Add file arg.
	(end_epilogue): Add line and file args.
	(dwarf2out_end_epilogue): Add line and file args.
	(vmsdbgout_after_prologue): Remove.
	* dwarf2out.c (dwarf2out_end_epilogue): Add line and file args.
	(dwarf2_debug_hooks): Update end_prologue.
	* dwarfout.c (dwarfout_end_epilogue): Add line and file args.
	(dwarfout_end_prologue): Add file arg.
	* final.c (vmsdbgout_after_prologue): Remove
	(final_end_function): Update end_epilogue call.
	(final_scan_insn): Update end_prologue call.
	* sdbout.c (sdbout_end_epilogue): Add line and file args.
	(sdbout_end_prologue): Add file arg.
	(sdb_debug_hooks): Update end_prologue.
	(sdb_begin_prologue): Update sdbout_end_prologue call.
	* vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_end_prologue,
	vmsdbgout_end_function.
	(vmsdbgout_end_prologue): New function renamed from
	vmsdbgout_after_prologue. Call vmsdbgout_source_line.
	(vmsdbgout_end_function): New function.
	(vmsdbgout_end_epilogue): Add line and file args. Call
	vmsdbgout_source_line.
	(write_pclines): Write only valid line numbers.
	(write_srccorr): Don't write source correlation records if 0 lines.
	* xcoffout.c (xcoffout_end_epilogue): Add line and file args.

From-SVN: r56356
This commit is contained in:
Douglas B Rupp 2002-08-15 19:59:29 +00:00 committed by Douglas Rupp
parent cb94b1559a
commit 702ada3d94
11 changed files with 156 additions and 97 deletions

View File

@ -1,3 +1,34 @@
2002-08-15 Douglas B Rupp <rupp@gnat.com>
* dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue.
(xcoff_debug_hooks): Update end_prologue.
* debug.c (do_nothing_debug_hooks): Update end_prologue, end_epilogue.
* debug.h (end_prologue): Add file arg.
(end_epilogue): Add line and file args.
(dwarf2out_end_epilogue): Add line and file args.
(vmsdbgout_after_prologue): Remove.
* dwarf2out.c (dwarf2out_end_epilogue): Add line and file args.
(dwarf2_debug_hooks): Update end_prologue.
* dwarfout.c (dwarfout_end_epilogue): Add line and file args.
(dwarfout_end_prologue): Add file arg.
* final.c (vmsdbgout_after_prologue): Remove
(final_end_function): Update end_epilogue call.
(final_scan_insn): Update end_prologue call.
* sdbout.c (sdbout_end_epilogue): Add line and file args.
(sdbout_end_prologue): Add file arg.
(sdb_debug_hooks): Update end_prologue.
(sdb_begin_prologue): Update sdbout_end_prologue call.
* vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_end_prologue,
vmsdbgout_end_function.
(vmsdbgout_end_prologue): New function renamed from
vmsdbgout_after_prologue. Call vmsdbgout_source_line.
(vmsdbgout_end_function): New function.
(vmsdbgout_end_epilogue): Add line and file args. Call
vmsdbgout_source_line.
(write_pclines): Write only valid line numbers.
(write_srccorr): Don't write source correlation records if 0 lines.
* xcoffout.c (xcoffout_end_epilogue): Add line and file args.
2002-08-15 Steve Ellcey <sje@cup.hp.com>
* gcc/unwind.h (_Unwind_Ptr): Make 64 bits on IA64 HP-UX.

View File

@ -1,6 +1,6 @@
/* Output dbx-format symbol table information from GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GCC.
@ -340,8 +340,8 @@ const struct gcc_debug_hooks dbx_debug_hooks =
debug_true_tree, /* ignore_block */
dbxout_source_line, /* source_line */
dbxout_source_line, /* begin_prologue: just output line info */
debug_nothing_int, /* end_prologue */
debug_nothing_void, /* end_epilogue */
debug_nothing_int_charstar, /* end_prologue */
debug_nothing_int_charstar, /* end_epilogue */
#ifdef DBX_FUNCTION_FIRST
dbxout_begin_function,
#else
@ -370,7 +370,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
debug_true_tree, /* ignore_block */
xcoffout_source_line,
xcoffout_begin_prologue, /* begin_prologue */
debug_nothing_int, /* end_prologue */
debug_nothing_int_charstar, /* end_prologue */
xcoffout_end_epilogue,
debug_nothing_tree, /* begin_function */
xcoffout_end_function,

View File

@ -33,8 +33,8 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
debug_true_tree, /* ignore_block */
debug_nothing_int_charstar, /* source_line */
debug_nothing_int_charstar, /* begin_prologue */
debug_nothing_int, /* end_prologue */
debug_nothing_void, /* end_epilogue */
debug_nothing_int_charstar, /* end_prologue */
debug_nothing_int_charstar, /* end_epilogue */
debug_nothing_tree, /* begin_function */
debug_nothing_int, /* end_function */
debug_nothing_tree, /* function_decl */

View File

@ -68,10 +68,10 @@ struct gcc_debug_hooks
/* Called at end of prologue code. LINE is the first line in the
function. */
void (* end_prologue) PARAMS ((unsigned int line));
void (* end_prologue) PARAMS ((unsigned int line, const char *file));
/* Record end of epilogue code. */
void (* end_epilogue) PARAMS ((void));
void (* end_epilogue) PARAMS ((unsigned int line, const char *file));
/* Called at start of function DECL, before it is declared. */
void (* begin_function) PARAMS ((tree decl));
@ -135,17 +135,11 @@ extern const struct gcc_debug_hooks vmsdbg_debug_hooks;
/* Dwarf2 frame information. */
extern void dwarf2out_begin_prologue PARAMS ((unsigned int, const char *));
extern void dwarf2out_end_epilogue PARAMS ((void));
extern void dwarf2out_end_epilogue PARAMS ((unsigned int, const char *));
extern void dwarf2out_frame_init PARAMS ((void));
extern void dwarf2out_frame_finish PARAMS ((void));
/* Decide whether we want to emit frame unwind information for the current
translation unit. */
extern int dwarf2out_do_frame PARAMS ((void));
/* When writing VMS debug info, output label after the prologue of the
function. */
extern void vmsdbgout_after_prologue PARAMS ((void));
#endif /* !GCC_DEBUG_H */

View File

@ -2131,7 +2131,9 @@ dwarf2out_begin_prologue (line, file)
been generated. */
void
dwarf2out_end_epilogue ()
dwarf2out_end_epilogue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
const char *file ATTRIBUTE_UNUSED;
{
dw_fde_ref fde;
char label[MAX_ARTIFICIAL_LABEL_BYTES];
@ -3106,7 +3108,7 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
dwarf2out_ignore_block,
dwarf2out_source_line,
dwarf2out_begin_prologue,
debug_nothing_int, /* end_prologue */
debug_nothing_int_charstar, /* end_prologue */
dwarf2out_end_epilogue,
debug_nothing_tree, /* begin_function */
debug_nothing_int, /* end_function */

View File

@ -1,6 +1,6 @@
/* Output Dwarf format symbol table information from the GNU C compiler.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 2002,
1999, 2000, 2001 Free Software Foundation, Inc.
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
This file is part of GCC.
@ -782,9 +782,9 @@ static void dwarfout_end_source_file PARAMS ((unsigned));
static void dwarfout_end_source_file_check PARAMS ((unsigned));
static void dwarfout_begin_block PARAMS ((unsigned, unsigned));
static void dwarfout_end_block PARAMS ((unsigned, unsigned));
static void dwarfout_end_epilogue PARAMS ((void));
static void dwarfout_end_epilogue PARAMS ((unsigned int, const char *));
static void dwarfout_source_line PARAMS ((unsigned int, const char *));
static void dwarfout_end_prologue PARAMS ((unsigned int));
static void dwarfout_end_prologue PARAMS ((unsigned int, const char *));
static void dwarfout_end_function PARAMS ((unsigned int));
static void dwarfout_function_decl PARAMS ((tree));
static void dwarfout_global_decl PARAMS ((tree));
@ -5835,8 +5835,9 @@ dwarfout_end_block (line, blocknum)
to their home locations). */
static void
dwarfout_end_prologue (line)
dwarfout_end_prologue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
const char *file ATTRIBUTE_UNUSED;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
@ -5869,7 +5870,9 @@ dwarfout_end_function (line)
has been generated. */
static void
dwarfout_end_epilogue ()
dwarfout_end_epilogue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
const char *file ATTRIBUTE_UNUSED;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];

View File

@ -1681,12 +1681,6 @@ final_start_function (first, file, optimize)
/* First output the function prologue: code to set up the stack frame. */
(*targetm.asm_out.function_prologue) (file, get_frame_size ());
#ifdef VMS_DEBUGGING_INFO
/* Output label after the prologue of the function. */
if (write_symbols == VMS_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
vmsdbgout_after_prologue ();
#endif
/* If the machine represents the prologue as RTL, the profiling code must
be emitted when NOTE_INSN_PROLOGUE_END is scanned. */
#ifdef HAVE_prologue
@ -1797,12 +1791,12 @@ final_end_function ()
(*targetm.asm_out.function_epilogue) (asm_out_file, get_frame_size ());
/* And debug output. */
(*debug_hooks->end_epilogue) ();
(*debug_hooks->end_epilogue) (last_linenum, last_filename);
#if defined (DWARF2_UNWIND_INFO)
if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG
&& dwarf2out_do_frame ())
dwarf2out_end_epilogue ();
dwarf2out_end_epilogue (last_linenum, last_filename);
#endif
}
@ -2061,7 +2055,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
case NOTE_INSN_FUNCTION_BEG:
app_disable ();
(*debug_hooks->end_prologue) (last_linenum);
(*debug_hooks->end_prologue) (last_linenum, last_filename);
break;
case NOTE_INSN_BLOCK_BEG:

View File

@ -102,12 +102,12 @@ static void sdbout_end_source_file PARAMS ((unsigned int));
static void sdbout_begin_block PARAMS ((unsigned int, unsigned int));
static void sdbout_end_block PARAMS ((unsigned int, unsigned int));
static void sdbout_source_line PARAMS ((unsigned int, const char *));
static void sdbout_end_epilogue PARAMS ((void));
static void sdbout_end_epilogue PARAMS ((unsigned int, const char *));
static void sdbout_global_decl PARAMS ((tree));
#ifndef MIPS_DEBUGGING_INFO
static void sdbout_begin_prologue PARAMS ((unsigned int, const char *));
#endif
static void sdbout_end_prologue PARAMS ((unsigned int));
static void sdbout_end_prologue PARAMS ((unsigned int, const char *));
static void sdbout_begin_function PARAMS ((tree));
static void sdbout_end_function PARAMS ((unsigned int));
static void sdbout_toplevel_data PARAMS ((tree));
@ -321,7 +321,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
sdbout_end_prologue, /* end_prologue */
#else
sdbout_begin_prologue, /* begin_prologue */
debug_nothing_int, /* end_prologue */
debug_nothing_int_charstar, /* end_prologue */
#endif
sdbout_end_epilogue, /* end_epilogue */
sdbout_begin_function, /* begin_function */
@ -1642,13 +1642,14 @@ sdbout_begin_prologue (line, file)
unsigned int line;
const char *file ATTRIBUTE_UNUSED;
{
sdbout_end_prologue (line);
sdbout_end_prologue (line, file);
}
#endif
static void
sdbout_end_prologue (line)
sdbout_end_prologue (line, file)
unsigned int line;
const char *file ATTRIBUTE_UNUSED;
{
sdb_begin_function_line = line - 1;
PUT_SDB_FUNCTION_START (line);
@ -1678,7 +1679,9 @@ sdbout_end_function (line)
Called after the epilogue is output. */
static void
sdbout_end_epilogue ()
sdbout_end_epilogue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
const char *file ATTRIBUTE_UNUSED;
{
const char *const name ATTRIBUTE_UNUSED
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl));

View File

@ -156,7 +156,9 @@ static void vmsdbgout_end_block PARAMS ((unsigned int, unsigned int));
static bool vmsdbgout_ignore_block PARAMS ((tree));
static void vmsdbgout_source_line PARAMS ((unsigned int, const char *));
static void vmsdbgout_begin_prologue PARAMS ((unsigned int, const char *));
static void vmsdbgout_end_epilogue PARAMS ((void));
static void vmsdbgout_end_prologue PARAMS ((unsigned int, const char *));
static void vmsdbgout_end_function PARAMS ((unsigned int));
static void vmsdbgout_end_epilogue PARAMS ((unsigned int, const char *));
static void vmsdbgout_begin_function PARAMS ((tree));
static void vmsdbgout_decl PARAMS ((tree));
static void vmsdbgout_global_decl PARAMS ((tree));
@ -176,10 +178,10 @@ const struct gcc_debug_hooks vmsdbg_debug_hooks
vmsdbgout_ignore_block,
vmsdbgout_source_line,
vmsdbgout_begin_prologue,
debug_nothing_int, /* end_prologue */
vmsdbgout_end_epilogue, /* end_epilogue */
vmsdbgout_begin_function, /* begin_function */
debug_nothing_int, /* end_function */
vmsdbgout_end_prologue,
vmsdbgout_end_epilogue,
vmsdbgout_begin_function,
vmsdbgout_end_function,
vmsdbgout_decl,
vmsdbgout_global_decl,
debug_nothing_tree, /* deferred_inline_function */
@ -984,8 +986,8 @@ write_pclines (dosizeonly)
totsize += write_debug_data1 (pcline.dst_b_pcline_command,
"line_num (SET LINUM LONG)", dosizeonly);
sprintf (buff, "line_num (%d)", ln - 1);
totsize += write_debug_data4 (ln - 1, buff, dosizeonly);
sprintf (buff, "line_num (%d)", ln ? ln - 1 : 0);
totsize += write_debug_data4 (ln ? ln - 1 : 0, buff, dosizeonly);
lastln = ln;
strcpy (lastlabel, TEXT_SECTION_ASM_OP);
@ -1184,62 +1186,66 @@ write_srccorr (fileid, file_info_entry, dosizeonly)
src_header.dst_a_source_corr_header.dst__header_type.dst_w_type
= DST_K_SOURCE;
totsize += write_debug_header (&src_header.dst_a_source_corr_header,
"source corr", dosizeonly);
totsize += write_debug_data1 (src_command_sf.dst_b_src_command,
"source_corr (src setfile)", dosizeonly);
totsize += write_debug_data2
(src_command_sf.dst_a_src_cmd_fields.dst_w_src_unsword,
"source_corr (fileid)", dosizeonly);
totsize += write_debug_data1 (src_command_sr.dst_b_src_command,
"source_corr (setrec)", dosizeonly);
totsize += write_debug_data2
(src_command_sr.dst_a_src_cmd_fields.dst_w_src_unsword,
"source_corr (recnum)", dosizeonly);
totsize += write_debug_data1 (src_command_sl.dst_b_src_command,
"source_corr (setlnum)", dosizeonly);
totsize += write_debug_data4
(src_command_sl.dst_a_src_cmd_fields.dst_l_src_unslong,
"source_corr (linenum)", dosizeonly);
totsize += write_debug_data1 (src_command_dl.dst_b_src_command,
"source_corr (deflines)", dosizeonly);
sprintf (buff, "source_corr (%d)",
src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword);
totsize += write_debug_data2
(src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword, buff, dosizeonly);
while (linesleft > 0)
if (src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword)
{
src_header.dst_a_source_corr_header.dst__header_length.dst_w_length
= DST_K_SOURCE_CORR_HEADER_SIZE + 3 - 1;
src_header.dst_a_source_corr_header.dst__header_type.dst_w_type
= DST_K_SOURCE;
src_command_dl.dst_b_src_command = DST_K_SRC_DEFLINES_W;
if (linesleft > 65534)
linesleft = linesleft - 65534, linestodo = 65534;
else
linestodo = linesleft, linesleft = 0;
src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword = linestodo;
totsize += write_debug_header (&src_header.dst_a_source_corr_header,
"source corr", dosizeonly);
totsize += write_debug_data1 (src_command_sf.dst_b_src_command,
"source_corr (src setfile)", dosizeonly);
totsize += write_debug_data2
(src_command_sf.dst_a_src_cmd_fields.dst_w_src_unsword,
"source_corr (fileid)", dosizeonly);
totsize += write_debug_data1 (src_command_sr.dst_b_src_command,
"source_corr (setrec)", dosizeonly);
totsize += write_debug_data2
(src_command_sr.dst_a_src_cmd_fields.dst_w_src_unsword,
"source_corr (recnum)", dosizeonly);
totsize += write_debug_data1 (src_command_sl.dst_b_src_command,
"source_corr (setlnum)", dosizeonly);
totsize += write_debug_data4
(src_command_sl.dst_a_src_cmd_fields.dst_l_src_unslong,
"source_corr (linenum)", dosizeonly);
totsize += write_debug_data1 (src_command_dl.dst_b_src_command,
"source_corr (deflines)", dosizeonly);
sprintf (buff, "source_corr (%d)",
src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword);
totsize += write_debug_data2
(src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword,
buff, dosizeonly);
while (linesleft > 0)
{
src_header.dst_a_source_corr_header.dst__header_length.dst_w_length
= DST_K_SOURCE_CORR_HEADER_SIZE + 3 - 1;
src_header.dst_a_source_corr_header.dst__header_type.dst_w_type
= DST_K_SOURCE;
src_command_dl.dst_b_src_command = DST_K_SRC_DEFLINES_W;
if (linesleft > 65534)
linesleft = linesleft - 65534, linestodo = 65534;
else
linestodo = linesleft, linesleft = 0;
src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword = linestodo;
totsize += write_debug_header (&src_header.dst_a_source_corr_header,
"source corr", dosizeonly);
totsize += write_debug_data1 (src_command_dl.dst_b_src_command,
"source_corr (deflines)", dosizeonly);
sprintf (buff, "source_corr (%d)",
src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword);
totsize += write_debug_data2
(src_command_dl.dst_a_src_cmd_fields.dst_w_src_unsword,
buff, dosizeonly);
}
}
return totsize;
@ -1285,30 +1291,50 @@ vmsdbgout_begin_prologue (line, file)
/* Output a marker (i.e. a label) for the beginning of a function, after
the prologue. */
void
vmsdbgout_after_prologue ()
static void
vmsdbgout_end_prologue (line, file)
unsigned int line;
const char *file;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
if (write_symbols == VMS_AND_DWARF2_DEBUG)
(*dwarf2_debug_hooks.end_prologue) (line, file);
if (debug_info_level > DINFO_LEVEL_TERSE)
{
ASM_GENERATE_INTERNAL_LABEL (label, FUNC_PROLOG_LABEL,
current_function_funcdef_no);
ASM_OUTPUT_LABEL (asm_out_file, label);
/* VMS PCA expects every PC range to correlate to some line and file */
vmsdbgout_source_line (line, file);
}
}
/* No output for VMS debug, but make obligatory call to Dwarf2 debug */
static void
vmsdbgout_end_function (line)
unsigned int line;
{
if (write_symbols == VMS_AND_DWARF2_DEBUG)
(*dwarf2_debug_hooks.end_function) (line);
}
/* Output a marker (i.e. a label) for the absolute end of the generated code
for a function definition. This gets called *after* the epilogue code has
been generated. */
static void
vmsdbgout_end_epilogue ()
vmsdbgout_end_epilogue (line, file)
unsigned int line;
const char *file;
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
if (write_symbols == VMS_AND_DWARF2_DEBUG)
(*dwarf2_debug_hooks.end_epilogue) ();
(*dwarf2_debug_hooks.end_epilogue) (line, file);
if (debug_info_level > DINFO_LEVEL_NONE)
{
@ -1317,6 +1343,9 @@ vmsdbgout_end_epilogue ()
ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL,
current_function_funcdef_no);
ASM_OUTPUT_LABEL (asm_out_file, label);
/* VMS PCA expects every PC range to correlate to some line and file */
vmsdbgout_source_line (line, file);
}
}

View File

@ -476,7 +476,9 @@ xcoffout_end_function (last_linenum)
Called after the epilogue is output. */
void
xcoffout_end_epilogue ()
xcoffout_end_epilogue (line, file)
unsigned int line ATTRIBUTE_UNUSED;
const char *file ATTRIBUTE_UNUSED;
{
/* We need to pass the correct function size to .function, otherwise,
the xas assembler can't figure out the correct size for the function

View File

@ -1,6 +1,6 @@
/* XCOFF definitions. These are needed in dbxout.c, final.c,
and xcoffout.h.
Copyright (C) 1998, 2000 Free Software Foundation, Inc.
Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
This file is part of GCC.
@ -202,7 +202,8 @@ extern int stab_to_sclass PARAMS ((int));
extern void xcoffout_begin_prologue PARAMS ((unsigned int,
const char *));
extern void xcoffout_begin_block PARAMS ((unsigned, unsigned));
extern void xcoffout_end_epilogue PARAMS ((void));
extern void xcoffout_end_epilogue PARAMS ((unsigned int,
const char *));
extern void xcoffout_end_function PARAMS ((unsigned int));
extern void xcoffout_end_block PARAMS ((unsigned, unsigned));
#endif /* BUFSIZ */