+2009-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/40521
+ * debug.h (struct gcc_debug_hooks): Add assembly_start hook.
+ * cgraphunit.c (cgraph_optimize): Call it.
+ * dwarf2out.c (dwarf2out_init): Move .cfi_sections printing into...
+ (dwarf2out_assembly_start): ... here. New hook.
+ (dwarf2out_debug_hooks): Add dwarf2out_assembly_start.
+ * debug.c (do_nothing_debug_hooks): Do nothing for assembly_start
+ hook.
+ * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_assembly_start.
+ (vmsdbgout_assembly_start): New hook.
+
2009-10-17 Alexandre Oliva <aoliva@redhat.com>
* rtl.h (RTL_LOCATION): Fix typo.
timevar_pop (TV_CGRAPHOPT);
/* Output everything. */
+ (*debug_hooks->assembly_start) ();
if (!quiet_flag)
fprintf (stderr, "Assembling functions:\n");
#ifdef ENABLE_CHECKING
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
{
debug_nothing_charstar,
debug_nothing_charstar,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
/* Output debug symbols. */
void (* finish) (const char *main_filename);
+ /* Called from cgraph_optimize before starting to assemble
+ functions/variables/toplevel asms. */
+ void (* assembly_start) (void);
+
/* Macro defined on line LINE with name and expansion TEXT. */
void (* define) (unsigned int line, const char *text);
static void dwarf2out_init (const char *);
static void dwarf2out_finish (const char *);
+static void dwarf2out_assembly_start (void);
static void dwarf2out_define (unsigned int, const char *);
static void dwarf2out_undef (unsigned int, const char *);
static void dwarf2out_start_source_file (unsigned, const char *);
{
dwarf2out_init,
dwarf2out_finish,
+ dwarf2out_assembly_start,
dwarf2out_define,
dwarf2out_undef,
dwarf2out_start_source_file,
ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label);
}
+}
+
+/* Called before cgraph_optimize starts outputtting functions, variables
+ and toplevel asms into assembly. */
+
+static void
+dwarf2out_assembly_start (void)
+{
if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE && dwarf2out_do_cfi_asm ())
{
#ifndef TARGET_UNWIND_INFO
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
{
sdbout_init, /* init */
sdbout_finish, /* finish */
+ debug_nothing_void, /* assembly_start */
debug_nothing_int_charstar, /* define */
debug_nothing_int_charstar, /* undef */
sdbout_start_source_file, /* start_source_file */
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
static void vmsdbgout_init (const char *);
static void vmsdbgout_finish (const char *);
+static void vmsdbgout_assembly_start (void);
static void vmsdbgout_define (unsigned int, const char *);
static void vmsdbgout_undef (unsigned int, const char *);
static void vmsdbgout_start_source_file (unsigned int, const char *);
const struct gcc_debug_hooks vmsdbg_debug_hooks
= {vmsdbgout_init,
vmsdbgout_finish,
+ vmsdbgout_assembly_start,
vmsdbgout_define,
vmsdbgout_undef,
vmsdbgout_start_source_file,
/* Not implemented in VMS Debug. */
static void
+vmsdbgout_assembly_start (void)
+{
+ if (write_symbols == VMS_AND_DWARF2_DEBUG)
+ (*dwarf2_debug_hooks.assembly_start) ();
+}
+
+/* Not implemented in VMS Debug. */
+
+static void
vmsdbgout_define (unsigned int lineno, const char *buffer)
{
if (write_symbols == VMS_AND_DWARF2_DEBUG)