https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69787

            Bug ID: 69787
           Summary: class only emitted as declaration in DWARF
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tromey at gcc dot gnu.org
  Target Milestone: ---

Created attachment 37673
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37673&action=edit
reduced test case

This is a debug info issue reduced from a firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1247769

This is similar to bug 12385, but different.


Consider the attached test case.
For this test we want to be able to see the debug info for
"TheOneWeWant".

If I compile the test with -g, I get the debug info:

 <1><52>: Abbrev Number: 6 (DW_TAG_class_type)
    <53>   DW_AT_name        : (indirect string, offset: 0x79): TheOneWeWant
    <57>   DW_AT_byte_size   : 1
    <58>   DW_AT_decl_file   : 1
    <59>   DW_AT_decl_line   : 27
    <5a>   DW_AT_sibling     : <0x79>

However, if I compile with "-g -DFAIL", the class is only emitted
as a declaration, causing gdb to ignore it:

 <1><84>: Abbrev Number: 9 (DW_TAG_class_type)
    <85>   DW_AT_name        : (indirect string, offset: 0x79): TheOneWeWant
    <89>   DW_AT_declaration : 1
    <89>   DW_AT_sibling     : <0xa1>


There doesn't seem to be any notable difference, to me, between the
success and fail cases here.  I think g++ ought to emit full debug info
for this class in both cases.

Also, it would be great if the rules for when debug info for a class
is emitted would be documented.  There are some flags documented
(-femit-class-debug-always and -fno-eliminate-unused-debug-types -- though
note these are separated widely in the info node, which is odd by itself);
and there is some information about other quasi-related things in the
"Vague Linkage" node; and one parenthetical mention in the "#pragma interface"
node.  In the current situation it's unclear to me what I can do in order
to get the debug info here.

Reply via email to