aboutsummaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@codesourcery.com>2006-07-14 15:54:23 +0000
committerCarlos O'Donell <carlos@gcc.gnu.org>2006-07-14 15:54:23 +0000
commit03471b3fcd6dd21855ba0ed90b7963d90904b08b (patch)
tree7371a8b2fee00fa92e9edb125a2420b945596e6d /gcc/dbxout.c
parent1470f196e47e33334ca4ff0cd71ebd3a1bad30de (diff)
downloadgcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.zip
gcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.tar.gz
gcc-03471b3fcd6dd21855ba0ed90b7963d90904b08b.tar.bz2
dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start.
gcc/ 2006-07-14 Carlos O'Donell <carlos@codesoucery.com> * dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start. (dbxout_function_end): Use local label LFBB. Remove hook DBX_OUTPUT_NFUN. (dbxout_source_line): Use local label LFBB. (dbxout_block): Likewise. (dbx_output_lbrac): Remove hook DBX_OUTPUT_LBRAC. (dbx_output_rbrac): Remove hook DBX_OUTPUT_RBRAC. * config/rs6000/linux64.h: Remove DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC, and DBX_OUTPUT_NFUN. From-SVN: r115444
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index f936ac6..07d0bcc 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -905,6 +905,7 @@ static void
dbxout_function_end (tree decl)
{
char lscope_label_name[100];
+ int lscope_labelno = scope_labelno++;
/* The Lscope label must be emitted even if we aren't doing anything
else; dbxout_block needs it. */
@@ -913,9 +914,8 @@ dbxout_function_end (tree decl)
/* Convert Lscope into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
labels. */
- ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", scope_labelno);
- targetm.asm_out.internal_label (asm_out_file, "Lscope", scope_labelno);
- scope_labelno++;
+ ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", lscope_labelno);
+ targetm.asm_out.internal_label (asm_out_file, "Lscope", lscope_labelno);
/* The N_FUN tag at the end of the function is a GNU extension,
which may be undesirable, and is unnecessary if we do not have
@@ -928,9 +928,6 @@ dbxout_function_end (tree decl)
/* By convention, GCC will mark the end of a function with an N_FUN
symbol and an empty string. */
-#ifdef DBX_OUTPUT_NFUN
- DBX_OUTPUT_NFUN (asm_out_file, lscope_label_name, current_function_decl);
-#else
if (flag_reorder_blocks_and_partition)
{
dbxout_begin_empty_stabs (N_FUN);
@@ -942,13 +939,12 @@ dbxout_function_end (tree decl)
}
else
{
+ char begin_label[20];
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", lscope_labelno);
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (lscope_label_name,
- XSTR (XEXP (DECL_RTL (current_function_decl),
- 0), 0));
+ dbxout_stab_value_label_diff (lscope_label_name, begin_label);
}
-
-#endif
if (!NO_DBX_BNSYM_ENSYM && !flag_debug_only_used_symbols)
dbxout_stabd (N_ENSYM, 0);
@@ -1241,7 +1237,8 @@ dbxout_source_file (const char *filename)
}
}
-/* Output N_BNSYM and line number symbol entry. */
+/* Output N_BNSYM, line number symbol entry, and local symbol at
+ function scope */
static void
dbxout_begin_prologue (unsigned int lineno, const char *filename)
@@ -1253,6 +1250,10 @@ dbxout_begin_prologue (unsigned int lineno, const char *filename)
dbxout_stabd (N_BNSYM, 0);
dbxout_source_line (lineno, filename);
+ /* Output function begin block at function scope, referenced
+ by dbxout_block, dbxout_source_line and dbxout_function_end. */
+ emit_pending_bincls_if_required ();
+ targetm.asm_out.internal_label (asm_out_file, "LFBB", scope_labelno);
}
/* Output a line number symbol entry for source file FILENAME and line
@@ -1268,11 +1269,12 @@ dbxout_source_line (unsigned int lineno, const char *filename)
#else
if (DBX_LINES_FUNCTION_RELATIVE)
{
- rtx begin_label = XEXP (DECL_RTL (current_function_decl), 0);
+ char begin_label[20];
dbxout_begin_stabn_sline (lineno);
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
- XSTR (begin_label, 0));
-
+ begin_label);
}
else
dbxout_stabd (N_SLINE, lineno);
@@ -3263,15 +3265,11 @@ static void
dbx_output_lbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED)
{
-#ifdef DBX_OUTPUT_LBRAC
- DBX_OUTPUT_LBRAC (asm_out_file, label);
-#else
dbxout_begin_stabn (N_LBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label);
else
dbxout_stab_value_label (label);
-#endif
}
/* Subroutine of dbxout_block. Emit an N_RBRAC stab referencing LABEL.
@@ -3281,15 +3279,11 @@ static void
dbx_output_rbrac (const char *label,
const char *begin_label ATTRIBUTE_UNUSED)
{
-#ifdef DBX_OUTPUT_RBRAC
- DBX_OUTPUT_RBRAC (asm_out_file, label);
-#else
dbxout_begin_stabn (N_RBRAC);
if (DBX_BLOCKS_FUNCTION_RELATIVE)
dbxout_stab_value_label_diff (label, begin_label);
else
dbxout_stab_value_label (label);
-#endif
}
/* Output everything about a symbol block (a BLOCK node
@@ -3312,8 +3306,9 @@ dbx_output_rbrac (const char *label,
static void
dbxout_block (tree block, int depth, tree args)
{
- const char *begin_label
- = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
+ char begin_label[20];
+ /* Reference current function start using LFBB. */
+ ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
while (block)
{
@@ -3342,7 +3337,7 @@ dbxout_block (tree block, int depth, tree args)
if (depth == 0)
/* The outermost block doesn't get LBB labels; use
- the function symbol. */
+ the LFBB local symbol emitted by dbxout_begin_prologue. */
scope_start = begin_label;
else
{