<html>
    <head>
      <base href="https://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 --- - Broken bitfield debug info in Dwarf4"
   href="https://llvm.org/bugs/show_bug.cgi?id=27758">27758</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Broken bitfield debug info in Dwarf4
          </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>mattias.v.eriksson@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am debugging an issue with bitfields and debug info and found that this
commit is where the problems begin.

The file tmp.c:

struct fields
{
  unsigned int a : 1;
  unsigned int b : 1;
} f;

int main ()
{
  f.a = 1;
  return 0;
}

Built with top-of-tree clang and run in gdb:

gdb a.out
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
...
Reading symbols from a.out...done.
(gdb) break main
Breakpoint 1 at 0x40058d: file tmp.c, line 9.
(gdb) run
Starting program: a.out 

Breakpoint 1, main () at tmp.c:9
9         f.a = 1;
(gdb) display f
1: f = {a = 0, b = 0}
(gdb) n
10        return 0;
1: f = {a = 1, b = 1}                 <<<--- Unexpected value of b!
(gdb) x &f
0x402024 <f>:   0x00000001
(gdb)

I have identified the first commit where this is broken as this one:
<a href="http://reviews.llvm.org/D19630">http://reviews.llvm.org/D19630</a></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>