<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - DW_TAG_typedef and DW_TAG_structure_type missing"
   href="http://llvm.org/bugs/show_bug.cgi?id=19005">19005</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DW_TAG_typedef and DW_TAG_structure_type missing
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tim.besard@elis.ugent.be
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12167" name="attach_12167" title="C test case.">attachment 12167</a> <a href="attachment.cgi?id=12167&action=edit" title="C test case.">[details]</a></span>
C test case.

Hi all,

On the attached test cases, both defining two structs value_t and example_t but
only using variables of type value_t* (accesses to example_t happen through
pointer casts) Clang doesn't seem to emit the necessary DW_TAGs for the
example_t type, while GCC does.

How to reproduce:
$(CC) -g test.c
- OR -
$(CXX) -g test.cpp
objdump -g a.out | grep example_t

Expected behaviour:
for C: DW_TAG_typedef tags for both value_t and example_t
for C++: DW_TAG_structure_type tags for these types

This matters for debugging purposes:
$ gdb ./a.out
(gdb) break 30
Breakpoint 1 at 0x4006a7: file test.cpp, line 30.
(gdb) run
Breakpoint 1, main () at test.cpp:30
30      return 0;
(gdb) print *value
$1 = {
  kind = 1
}
(gdb) print *(example_t*)value
$2 = {
  kind = 1, 
  foo = 42
}

When compiling with clang(++), this latest cast doesn't work:
(gdb) print *(example_t*)value
No symbol "example_t" in current context.</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>