------- Comment #4 from jason at redhat dot com 2008-10-17 15:18 ------- Subject: Re: DWARF output for inlined functions doesn't always use DW_TAG_inlined_subroutine
These bits should not be generated: <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> .... <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> Basically, when we're generating the debug info for the abstract instance of an inline function we shouldn't emit any information about other inline functions, as it would be redundant. We shouldn't see any DW_AT_abstract_origin attributes inside a DW_TAG_subprogram with DW_AT_inline set. Incidentally, it seems that we're also emitting these unnecessary DW_TAG_lexical_block inside the concrete instances (DW_TAG_inlined_subroutine): For instance, <3><1a5>: Abbrev Number: 14 (DW_TAG_lexical_block) <1a6> DW_AT_low_pc : 0x40046f <1ae> DW_AT_high_pc : 0x400479 should be dropped, and <4><1b6>: Abbrev Number: 9 (DW_TAG_variable) <1b7> DW_AT_abstract_origin: <0x81> should be at level 3, directly under the DW_TAG_inlined_subroutine. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37801