https://llvm.org/bugs/show_bug.cgi?id=27758

            Bug ID: 27758
           Summary: Broken bitfield debug info in Dwarf4
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: DebugInfo
          Assignee: unassignedb...@nondot.org
          Reporter: mattias.v.eriks...@ericsson.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

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:
http://reviews.llvm.org/D19630

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to