This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
exception-section patch, part 4
- To: egcs-patches at cygnus dot com
- Subject: exception-section patch, part 4
- From: Bruno Haible <haible at ilog dot fr>
- Date: Wed, 1 Jul 1998 00:10:02 +0200 (MET DST)
Patch #10 needs to mark some block notes as "deleted", so that no debugging
information is output for them. However, the "subblocks" of such a block
are not deleted, because they may extend into the text section; the debugging
information for them must be output.
This patch adds a "deleted" marker to blocks and modifies dbxout.c
accordingly (mostly whitespace changes).
Sun Jun 28 19:49:33 1998 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* tree.h (struct tree_block): New field deleted_flag.
(BLOCK_DELETED): New macro.
* dbxout.c (dbxout_block): Don't output deleted blocks, but do output
their subblocks.
diff -c3p egcs-19980628/gcc/tree.h.bak egcs-19980628/gcc/tree.h
*** egcs-19980628/gcc/tree.h.bak Thu Jun 25 17:14:18 1998
--- egcs-19980628/gcc/tree.h Tue Jun 30 13:08:25 1998
*************** struct tree_exp
*** 706,711 ****
--- 706,712 ----
#define BLOCK_CHAIN(NODE) TREE_CHAIN (NODE)
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
+ #define BLOCK_DELETED(NODE) (BLOCK_CHECK (NODE)->block.deleted_flag)
#define BLOCK_END_NOTE(NODE) (BLOCK_CHECK (NODE)->block.end_note)
/* Nonzero means that this block has separate live range regions */
#define BLOCK_LIVE_RANGE_FLAG(NOTE) (BLOCK_CHECK (NOTE)->block.live_range_flag)
*************** struct tree_block
*** 732,737 ****
--- 733,739 ----
unsigned abstract_flag : 1;
unsigned live_range_flag : 1;
unsigned live_range_var_flag : 1;
+ unsigned deleted_flag : 1;
union tree_node *vars;
union tree_node *type_tags;
diff -c3p egcs-19980628/gcc/dbxout.c.bak egcs-19980628/gcc/dbxout.c
*** egcs-19980628/gcc/dbxout.c.bak Thu Jun 4 15:15:44 1998
--- egcs-19980628/gcc/dbxout.c Tue Jun 30 13:06:37 1998
*************** dbxout_block (block, depth, args)
*** 2581,2629 ****
dbxout_reg_parms (args);
#endif
! /* Now output an N_LBRAC symbol to represent the beginning of
! the block. Use the block's tree-walk order to generate
! the assembler symbols LBBn and LBEn
! that final will define around the code in this block. */
! if (depth > 0 && debug_info_level != DINFO_LEVEL_TERSE)
{
! char buf[20];
! blocknum = next_block_number++;
! ASM_GENERATE_INTERNAL_LABEL (buf, "LBB", blocknum);
!
! if (BLOCK_HANDLER_BLOCK (block))
{
! /* A catch block. Must precede N_LBRAC. */
! tree decl = BLOCK_VARS (block);
! while (decl)
{
#ifdef DBX_OUTPUT_CATCH
! DBX_OUTPUT_CATCH (asmfile, decl, buf);
#else
! fprintf (asmfile, "%s \"%s:C1\",%d,0,0,", ASM_STABS_OP,
! IDENTIFIER_POINTER (DECL_NAME (decl)), N_CATCH);
! assemble_name (asmfile, buf);
! fprintf (asmfile, "\n");
#endif
! decl = TREE_CHAIN (decl);
}
- }
#ifdef DBX_OUTPUT_LBRAC
! DBX_OUTPUT_LBRAC (asmfile, buf);
#else
! fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC);
! assemble_name (asmfile, buf);
#if DBX_BLOCKS_FUNCTION_RELATIVE
! fputc ('-', asmfile);
! assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
#endif
! fprintf (asmfile, "\n");
#endif
}
- else if (depth > 0)
- /* Count blocks the same way regardless of debug_info_level. */
- next_block_number++;
#ifdef DBX_LBRAC_FIRST
/* On some weird machines, the syms of a block
--- 2581,2634 ----
dbxout_reg_parms (args);
#endif
! if (depth > 0 && ! BLOCK_DELETED (block))
{
! /* Now output an N_LBRAC symbol to represent the beginning of
! the block. Use the block's tree-walk order to generate
! the assembler symbols LBBn and LBEn
! that final will define around the code in this block. */
! if (debug_info_level != DINFO_LEVEL_TERSE)
{
! char buf[20];
! blocknum = next_block_number;
! ASM_GENERATE_INTERNAL_LABEL (buf, "LBB", blocknum);
!
! if (BLOCK_HANDLER_BLOCK (block))
{
+ /* A catch block. Must precede N_LBRAC. */
+ tree decl = BLOCK_VARS (block);
+ while (decl)
+ {
#ifdef DBX_OUTPUT_CATCH
! DBX_OUTPUT_CATCH (asmfile, decl, buf);
#else
! fprintf (asmfile, "%s \"%s:C1\",%d,0,0,",
! ASM_STABS_OP,
! IDENTIFIER_POINTER (DECL_NAME (decl)),
! N_CATCH);
! assemble_name (asmfile, buf);
! fprintf (asmfile, "\n");
#endif
! decl = TREE_CHAIN (decl);
! }
}
#ifdef DBX_OUTPUT_LBRAC
! DBX_OUTPUT_LBRAC (asmfile, buf);
#else
! fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC);
! assemble_name (asmfile, buf);
#if DBX_BLOCKS_FUNCTION_RELATIVE
! fputc ('-', asmfile);
! assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
#endif
! fprintf (asmfile, "\n");
#endif
+ }
+
+ /* Count blocks the same way regardless of debug_info_level. */
+ next_block_number++;
}
#ifdef DBX_LBRAC_FIRST
/* On some weird machines, the syms of a block
*************** dbxout_block (block, depth, args)
*** 2638,2659 ****
dbxout_block (BLOCK_SUBBLOCKS (block), depth + 1, NULL_TREE);
/* Refer to the marker for the end of the block. */
! if (depth > 0 && debug_info_level != DINFO_LEVEL_TERSE)
! {
! char buf[20];
! ASM_GENERATE_INTERNAL_LABEL (buf, "LBE", blocknum);
#ifdef DBX_OUTPUT_RBRAC
! DBX_OUTPUT_RBRAC (asmfile, buf);
#else
! fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC);
! assemble_name (asmfile, buf);
#if DBX_BLOCKS_FUNCTION_RELATIVE
! fputc ('-', asmfile);
! assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
#endif
! fprintf (asmfile, "\n");
#endif
! }
}
block = BLOCK_CHAIN (block);
}
--- 2643,2665 ----
dbxout_block (BLOCK_SUBBLOCKS (block), depth + 1, NULL_TREE);
/* Refer to the marker for the end of the block. */
! if (depth > 0 && ! BLOCK_DELETED (block))
! if (debug_info_level != DINFO_LEVEL_TERSE)
! {
! char buf[20];
! ASM_GENERATE_INTERNAL_LABEL (buf, "LBE", blocknum);
#ifdef DBX_OUTPUT_RBRAC
! DBX_OUTPUT_RBRAC (asmfile, buf);
#else
! fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC);
! assemble_name (asmfile, buf);
#if DBX_BLOCKS_FUNCTION_RELATIVE
! fputc ('-', asmfile);
! assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
#endif
! fprintf (asmfile, "\n");
#endif
! }
}
block = BLOCK_CHAIN (block);
}