This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/37801] DWARF output for inlined functions doesn't always use DW_TAG_inlined_subroutine
- From: "xuepeng dot guo at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Oct 2008 07:36:14 -0000
- Subject: [Bug debug/37801] DWARF output for inlined functions doesn't always use DW_TAG_inlined_subroutine
- References: <bug-37801-114@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from xuepeng dot guo at intel dot com 2008-10-16 07:36 -------
Hello Jason, I posted the whole debug_info section of of the binary file of
your example as below. I guess you mean that DW_TAG_lexical_block tags like
those at <8c> and <8d> are unnecessary. We should avoid generating them if they
contain nothing. Am I right?
The section .debug_info contains:
Compilation Unit @ offset 0x0:
Length: 0x2a2 (32-bit)
Version: 2
Abbrev Offset: 0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
< c> DW_AT_producer : (indirect string, offset: 0x58): GNU C 4.4.0
20081005 (experimental) [trunk revision 4110]
<10> DW_AT_language : 1 (ANSI C)
<11> DW_AT_name : (indirect string, offset: 0x0): 37801.c
<15> DW_AT_comp_dir : (indirect string, offset: 0xd): /home/xguo2/work
<19> DW_AT_low_pc : 0x40045c
<21> DW_AT_high_pc : 0x40048b
<29> DW_AT_stmt_list : 0x0
<1><2d>: Abbrev Number: 2 (DW_TAG_subprogram)
<2e> DW_AT_external : 1
<2f> DW_AT_name : (indirect string, offset: 0x3c): third
<33> DW_AT_decl_file : 1
<34> DW_AT_decl_line : 2
<35> DW_AT_prototyped : 1
<36> DW_AT_inline : 3 (declared as inline and inlined)
<37> DW_AT_sibling : <0x5b>
<2><3b>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<3c> DW_AT_name : (indirect string, offset: 0x53): arg3
<40> DW_AT_decl_file : 1
<41> DW_AT_decl_line : 2
<42> DW_AT_type : <0x5b>
<2><46>: Abbrev Number: 4 (DW_TAG_variable)
<47> DW_AT_name : (indirect string, offset: 0x37): var3
<4b> DW_AT_decl_file : 1
<4c> DW_AT_decl_line : 4
<4d> DW_AT_type : <0x5b>
<2><51>: Abbrev Number: 5 (DW_TAG_variable)
<52> DW_AT_name : a
<54> DW_AT_decl_file : 1
<55> DW_AT_decl_line : 5
<56> DW_AT_type : <0x62>
<1><5b>: Abbrev Number: 6 (DW_TAG_base_type)
<5c> DW_AT_byte_size : 4
<5d> DW_AT_encoding : 5 (signed)
<5e> DW_AT_name : int
<1><62>: Abbrev Number: 7 (DW_TAG_pointer_type)
<63> DW_AT_byte_size : 8
<64> DW_AT_type : <0x5b>
<1><68>: Abbrev Number: 2 (DW_TAG_subprogram)
<69> DW_AT_external : 1
<6a> DW_AT_name : (indirect string, offset: 0x42): second
<6e> DW_AT_decl_file : 1
<6f> DW_AT_decl_line : 9
<70> DW_AT_prototyped : 1
<71> DW_AT_inline : 3 (declared as inline and inlined)
<72> DW_AT_sibling : <0x9b>
<2><76>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<77> DW_AT_name : (indirect string, offset: 0x4e): arg2
<7b> DW_AT_decl_file : 1
<7c> DW_AT_decl_line : 9
<7d> DW_AT_type : <0x5b>
<2><81>: Abbrev Number: 4 (DW_TAG_variable)
<82> DW_AT_name : (indirect string, offset: 0x32): var2
<86> DW_AT_decl_file : 1
<87> DW_AT_decl_line : 10
<88> DW_AT_type : <0x5b>
<2><8c>: Abbrev Number: 8 (DW_TAG_lexical_block)
<3><8d>: Abbrev Number: 8 (DW_TAG_lexical_block)
<4><8e>: Abbrev Number: 9 (DW_TAG_variable)
<8f> DW_AT_abstract_origin: <0x46>
<4><93>: Abbrev Number: 9 (DW_TAG_variable)
<94> DW_AT_abstract_origin: <0x51>
<1><9b>: Abbrev Number: 2 (DW_TAG_subprogram)
<9c> DW_AT_external : 1
<9d> DW_AT_name : (indirect string, offset: 0x27): first
<a1> DW_AT_decl_file : 1
<a2> DW_AT_decl_line : 14
<a3> DW_AT_prototyped : 1
<a4> DW_AT_inline : 3 (declared as inline and inlined)
<a5> DW_AT_sibling : <0xd7>
<2><a9>: Abbrev Number: 3 (DW_TAG_formal_parameter)
<aa> DW_AT_name : (indirect string, offset: 0x49): arg1
<ae> DW_AT_decl_file : 1
<af> DW_AT_decl_line : 14
<b0> DW_AT_type : <0x5b>
<2><b4>: Abbrev Number: 4 (DW_TAG_variable)
<b5> DW_AT_name : (indirect string, offset: 0x2d): var1
<b9> DW_AT_decl_file : 1
<ba> DW_AT_decl_line : 15
<bb> DW_AT_type : <0x5b>
<2><bf>: Abbrev Number: 8 (DW_TAG_lexical_block)
<3><c0>: Abbrev Number: 8 (DW_TAG_lexical_block)
<4><c1>: Abbrev Number: 9 (DW_TAG_variable)
<c2> DW_AT_abstract_origin: <0x81>
<4><c6>: Abbrev Number: 8 (DW_TAG_lexical_block)
<5><c7>: Abbrev Number: 8 (DW_TAG_lexical_block)
<6><c8>: Abbrev Number: 9 (DW_TAG_variable)
<c9> DW_AT_abstract_origin: <0x46>
<6><cd>: Abbrev Number: 9 (DW_TAG_variable)
<ce> DW_AT_abstract_origin: <0x51>
<1><d7>: Abbrev Number: 10 (DW_TAG_subprogram)
<d8> DW_AT_abstract_origin: <0x2d>
<dc> DW_AT_low_pc : 0x40045c
<e4> DW_AT_high_pc : 0x400464
<ec> DW_AT_frame_base : 2 byte block: 77 8 (DW_OP_breg7: 8)
<ef> DW_AT_sibling : <0x105>
<2><f3>: Abbrev Number: 11 (DW_TAG_formal_parameter)
<f4> DW_AT_abstract_origin: <0x3b>
<f8> DW_AT_location : 1 byte block: 55 (DW_OP_reg5)
<2><fa>: Abbrev Number: 9 (DW_TAG_variable)
<fb> DW_AT_abstract_origin: <0x46>
<2><ff>: Abbrev Number: 9 (DW_TAG_variable)
<100> DW_AT_abstract_origin: <0x51>
<1><105>: Abbrev Number: 10 (DW_TAG_subprogram)
<106> DW_AT_abstract_origin: <0x68>
<10a> DW_AT_low_pc : 0x400464
<112> DW_AT_high_pc : 0x40046f
<11a> DW_AT_frame_base : 2 byte block: 77 8 (DW_OP_breg7: 8)
<11d> DW_AT_sibling : <0x164>
<2><121>: Abbrev Number: 12 (DW_TAG_formal_parameter)
<122> DW_AT_abstract_origin: <0x76>
<126> DW_AT_location : 0x0 (location list)
<2><12a>: Abbrev Number: 9 (DW_TAG_variable)
<12b> DW_AT_abstract_origin: <0x81>
<2><12f>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<130> DW_AT_abstract_origin: <0x2d>
<134> DW_AT_low_pc : 0x400467
<13c> DW_AT_high_pc : 0x40046e
<144> DW_AT_call_file : 1
<145> DW_AT_call_line : 11
<3><146>: Abbrev Number: 14 (DW_TAG_lexical_block)
<147> DW_AT_low_pc : 0x400467
<14f> DW_AT_high_pc : 0x40046e
<4><157>: Abbrev Number: 9 (DW_TAG_variable)
<158> DW_AT_abstract_origin: <0x46>
<4><15c>: Abbrev Number: 9 (DW_TAG_variable)
<15d> DW_AT_abstract_origin: <0x51>
<1><164>: Abbrev Number: 10 (DW_TAG_subprogram)
<165> DW_AT_abstract_origin: <0x9b>
<169> DW_AT_low_pc : 0x40046f
<171> DW_AT_high_pc : 0x40047a
<179> DW_AT_frame_base : 2 byte block: 77 8 (DW_OP_breg7: 8)
<17c> DW_AT_sibling : <0x1f2>
<2><180>: Abbrev Number: 12 (DW_TAG_formal_parameter)
<181> DW_AT_abstract_origin: <0xa9>
<185> DW_AT_location : 0x23 (location list)
<2><189>: Abbrev Number: 9 (DW_TAG_variable)
<18a> DW_AT_abstract_origin: <0xb4>
<2><18e>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<18f> DW_AT_abstract_origin: <0x68>
<193> DW_AT_low_pc : 0x40046f
<19b> DW_AT_high_pc : 0x400479
<1a3> DW_AT_call_file : 1
<1a4> DW_AT_call_line : 16
<3><1a5>: Abbrev Number: 14 (DW_TAG_lexical_block)
<1a6> DW_AT_low_pc : 0x40046f
<1ae> DW_AT_high_pc : 0x400479
<4><1b6>: Abbrev Number: 9 (DW_TAG_variable)
<1b7> DW_AT_abstract_origin: <0x81>
<4><1bb>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<1bc> DW_AT_abstract_origin: <0x2d>
<1c0> DW_AT_low_pc : 0x400472
<1c8> DW_AT_high_pc : 0x400479
<1d0> DW_AT_call_file : 1
<1d1> DW_AT_call_line : 11
<5><1d2>: Abbrev Number: 14 (DW_TAG_lexical_block)
<1d3> DW_AT_low_pc : 0x400472
<1db> DW_AT_high_pc : 0x400479
<6><1e3>: Abbrev Number: 9 (DW_TAG_variable)
<1e4> DW_AT_abstract_origin: <0x46>
<6><1e8>: Abbrev Number: 9 (DW_TAG_variable)
<1e9> DW_AT_abstract_origin: <0x51>
<1><1f2>: Abbrev Number: 15 (DW_TAG_subprogram)
<1f3> DW_AT_external : 1
<1f4> DW_AT_name : (indirect string, offset: 0x8): main
<1f8> DW_AT_decl_file : 1
<1f9> DW_AT_decl_line : 19
<1fa> DW_AT_type : <0x5b>
<1fe> DW_AT_low_pc : 0x40047a
<206> DW_AT_high_pc : 0x40048b
<20e> DW_AT_frame_base : 2 byte block: 77 8 (DW_OP_breg7: 8)
<2><211>: Abbrev Number: 4 (DW_TAG_variable)
<212> DW_AT_name : (indirect string, offset: 0x1e): some_int
<216> DW_AT_decl_file : 1
<217> DW_AT_decl_line : 20
<218> DW_AT_type : <0x5b>
<2><21c>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<21d> DW_AT_abstract_origin: <0x9b>
<221> DW_AT_low_pc : 0x40047a
<229> DW_AT_high_pc : 0x400485
<231> DW_AT_call_file : 1
<232> DW_AT_call_line : 21
<3><233>: Abbrev Number: 14 (DW_TAG_lexical_block)
<234> DW_AT_low_pc : 0x40047a
<23c> DW_AT_high_pc : 0x400485
<4><244>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<245> DW_AT_abstract_origin: <0x68>
<249> DW_AT_low_pc : 0x40047a
<251> DW_AT_high_pc : 0x400485
<259> DW_AT_call_file : 1
<25a> DW_AT_call_line : 16
<5><25b>: Abbrev Number: 14 (DW_TAG_lexical_block)
<25c> DW_AT_low_pc : 0x40047a
<264> DW_AT_high_pc : 0x400485
<6><26c>: Abbrev Number: 13 (DW_TAG_inlined_subroutine)
<26d> DW_AT_abstract_origin: <0x2d>
<271> DW_AT_low_pc : 0x40047a
<279> DW_AT_high_pc : 0x400485
<281> DW_AT_call_file : 1
<282> DW_AT_call_line : 11
<7><283>: Abbrev Number: 14 (DW_TAG_lexical_block)
<284> DW_AT_low_pc : 0x40047a
<28c> DW_AT_high_pc : 0x400485
<8><294>: Abbrev Number: 9 (DW_TAG_variable)
<295> DW_AT_abstract_origin: <0x46>
<8><299>: Abbrev Number: 9 (DW_TAG_variable)
<29a> DW_AT_abstract_origin: <0x51>
--
xuepeng dot guo at intel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xuepeng dot guo at intel dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37801