diff options
author | James E. Wilson <wilson@specifixinc.com> | 2005-11-21 09:55:14 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-11-21 09:55:14 +0000 |
commit | ec7be0798b7830ac0b9426e265b9ca1840effbbd (patch) | |
tree | 2d1876072b279ae5b0ffcd4a228e01b5a04e2399 | |
parent | 5d6e35cf33e049d7fded7f96666b65371520583a (diff) |
PR debug/20268
* dwarf2out.c (add_high_low_attributes): New function, extracted from
gen_lexical_block_die.
(gen_lexical_block_die, gen_inlined_subroutine_die): Call it.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_0-rhl-branch@107300 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 67 |
2 files changed, 42 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f713a967c39..bf129f8b5a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-03-30 James E. Wilson <wilson@specifixinc.com> + + PR debug/20268 + * dwarf2out.c (add_high_low_attributes): New function, extracted from + gen_lexical_block_die. + (gen_lexical_block_die, gen_inlined_subroutine_die): Call it. + 2005-08-10 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (add_location_or_const_value_attribute): Prefer diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 445d0d832ce..c520b962d28 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11678,41 +11678,49 @@ gen_label_die (tree decl, dw_die_ref context_die) } } -/* Generate a DIE for a lexical block. */ +/* A helper function for gen_lexical_block_die and gen_inlined_subroutine_die. + Add low_pc and high_pc attributes to the DIE for a block STMT. */ -static void -gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth) +static inline void +add_high_low_attributes (tree stmt, dw_die_ref die) { - dw_die_ref stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); char label[MAX_ARTIFICIAL_LABEL_BYTES]; - if (! BLOCK_ABSTRACT (stmt)) + if (BLOCK_FRAGMENT_CHAIN (stmt)) { - if (BLOCK_FRAGMENT_CHAIN (stmt)) - { - tree chain; + tree chain; - add_AT_range_list (stmt_die, DW_AT_ranges, add_ranges (stmt)); + add_AT_range_list (die, DW_AT_ranges, add_ranges (stmt)); - chain = BLOCK_FRAGMENT_CHAIN (stmt); - do - { - add_ranges (chain); - chain = BLOCK_FRAGMENT_CHAIN (chain); - } - while (chain); - add_ranges (NULL); - } - else + chain = BLOCK_FRAGMENT_CHAIN (stmt); + do { - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (stmt_die, DW_AT_low_pc, label); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (stmt_die, DW_AT_high_pc, label); + add_ranges (chain); + chain = BLOCK_FRAGMENT_CHAIN (chain); } + while (chain); + add_ranges (NULL); + } + else + { + ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, + BLOCK_NUMBER (stmt)); + add_AT_lbl_id (die, DW_AT_low_pc, label); + ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, + BLOCK_NUMBER (stmt)); + add_AT_lbl_id (die, DW_AT_high_pc, label); } +} + +/* Generate a DIE for a lexical block. */ + +static void +gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth) +{ + dw_die_ref stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); + + if (! BLOCK_ABSTRACT (stmt)) + add_high_low_attributes (stmt, stmt_die); decls_for_scope (stmt, stmt_die, depth); } @@ -11734,15 +11742,10 @@ gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die, int depth) { dw_die_ref subr_die = new_die (DW_TAG_inlined_subroutine, context_die, stmt); - char label[MAX_ARTIFICIAL_LABEL_BYTES]; add_abstract_origin_attribute (subr_die, decl); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (subr_die, DW_AT_low_pc, label); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (subr_die, DW_AT_high_pc, label); + add_high_low_attributes (stmt, subr_die); + decls_for_scope (stmt, subr_die, depth); current_function_has_inlines = 1; } |