aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-10-17 09:28:13 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-10-17 09:28:13 +0200
commit3df9609a72613e190c828cb991277492eede618b (patch)
tree23f3349f6a491c65d7cf0e47085ccdcb36592488 /gcc
parent15f01e4ad6100fad0a4ecd8ee920840edc4459d3 (diff)
downloadgcc-3df9609a72613e190c828cb991277492eede618b.zip
gcc-3df9609a72613e190c828cb991277492eede618b.tar.gz
gcc-3df9609a72613e190c828cb991277492eede618b.tar.bz2
re PR debug/40521 (-g causes GCC to generate .eh_frame)
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. From-SVN: r152930
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/cgraphunit.c1
-rw-r--r--gcc/dbxout.c2
-rw-r--r--gcc/debug.c1
-rw-r--r--gcc/debug.h4
-rw-r--r--gcc/dwarf2out.c11
-rw-r--r--gcc/sdbout.c2
-rw-r--r--gcc/vmsdbgout.c11
8 files changed, 47 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 80667d3..007d78e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+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.
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 9a97bef..47ee7d9 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1441,6 +1441,7 @@ cgraph_optimize (void)
timevar_pop (TV_CGRAPHOPT);
/* Output everything. */
+ (*debug_hooks->assembly_start) ();
if (!quiet_flag)
fprintf (stderr, "Assembling functions:\n");
#ifdef ENABLE_CHECKING
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index d09087a..b5688d9 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -346,6 +346,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
@@ -386,6 +387,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
{
dbxout_init,
dbxout_finish,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
dbxout_start_source_file,
diff --git a/gcc/debug.c b/gcc/debug.c
index 8035c43..c413595 100644
--- a/gcc/debug.c
+++ b/gcc/debug.c
@@ -27,6 +27,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
{
debug_nothing_charstar,
debug_nothing_charstar,
+ debug_nothing_void,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int_charstar,
diff --git a/gcc/debug.h b/gcc/debug.h
index 4009cd6..ef611d4 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -31,6 +31,10 @@ struct gcc_debug_hooks
/* 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);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 00adf06..ba59251 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5401,6 +5401,7 @@ static int output_indirect_string (void **, void *);
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 *);
@@ -5427,6 +5428,7 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
{
dwarf2out_init,
dwarf2out_finish,
+ dwarf2out_assembly_start,
dwarf2out_define,
dwarf2out_undef,
dwarf2out_start_source_file,
@@ -20392,6 +20394,14 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
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
@@ -21274,6 +21284,7 @@ const struct gcc_debug_hooks dwarf2_debug_hooks =
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 0553740..e7d52a6 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -307,6 +307,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
{
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 */
@@ -1705,6 +1706,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
{
0, /* init */
0, /* finish */
+ 0, /* assembly_start */
0, /* define */
0, /* undef */
0, /* start_source_file */
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 0fab5e7..b16e76e 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -168,6 +168,7 @@ static int write_srccorrs (int);
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 *);
@@ -190,6 +191,7 @@ static void vmsdbgout_abstract_function (tree);
const struct gcc_debug_hooks vmsdbg_debug_hooks
= {vmsdbgout_init,
vmsdbgout_finish,
+ vmsdbgout_assembly_start,
vmsdbgout_define,
vmsdbgout_undef,
vmsdbgout_start_source_file,
@@ -1618,6 +1620,15 @@ vmsdbgout_init (const char *main_input_filename)
/* 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)