<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - debug info is missing information about a structure."
   href="https://bugs.llvm.org/show_bug.cgi?id=38822">38822</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>debug info is missing information about a structure.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DebugInfo
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20834" name="attach_20834" title="lib.cc">attachment 20834</a> <a href="attachment.cgi?id=20834&action=edit" title="lib.cc">[details]</a></span>
lib.cc

This is a reproducer:

clang++ -fPIC -g -shared -o lib.so lib.cc
readelf -wai lib.so

....

<1><54>: Abbrev Number: 6 (DW_TAG_structure_type)
    <55>   DW_AT_name        : (indirect string, offset: 0x11a): Foo
    <59>   DW_AT_declaration : 1
.... 

Where if the same file compiled using g++ it provides full information about
structure_type:

g++ -fPIC -g -shared -o lib.so lib.cc
readelf -wai lib.so

...
 <1><2d>: Abbrev Number: 2 (DW_TAG_structure_type)
    <2e>   DW_AT_name        : Foo
    <32>   DW_AT_byte_size   : 4
    <33>   DW_AT_decl_file   : 2
    <34>   DW_AT_decl_line   : 1
    <35>   DW_AT_sibling     : <0x46>
 <2><39>: Abbrev Number: 3 (DW_TAG_member)
    <3a>   DW_AT_name        : (indirect string, offset: 0x41): value
    <3e>   DW_AT_decl_file   : 2
    <3f>   DW_AT_decl_line   : 2
    <40>   DW_AT_type        : <0x46>
    <44>   DW_AT_data_member_location: 0
...


It would be nice to have full debug info of a referenced structure even when
some fields of this structure are not used.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>