[Bug 15260] New: lldb on Linux does not display the correct value of bit fields

Bug ID 15260
Summary lldb on Linux does not display the correct value of bit fields
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter daniel.malea@intel.com
Classification Unclassified

The testcase TestBitfields.py fails because a single bit is not displayed
correctly in a structure that uses bit masks. Interestingly, the other members
of the struct (before and after the 1-bit member) seem to be displayed
correctly. 

To reproduce with clang on an x86_64 linux build, run:

python dotest.py lang/c/bitfields

The trace of the failure is below:

runCmd: frame variable --show-types more_bits
output: (MoreBits) more_bits = { 
  (uint32_t:3) a = 3 
  (int:1)  = -1
  (uint8_t:1) b = '\0'
  (uint8_t:1) c = '\x01'
  (uint8_t:1) d = '\0'
}

Expecting sub string: (uint32_t:3) a = 3 
Matched

Expecting sub string: (int:1)  = 0 
Not matched

FAIL

Traceback (most recent call last):
  File "/home/daniel/dev/llvm-svn/tools/lldb/test/lldbtest.py", line 365, in
wrapper
    return func(self, *args, **kwargs)
  File
"/home/daniel/dev/llvm-svn/tools/lldb/test/lang/c/bitfields/TestBitfields.py",
line 32, in test_with_dwarf_and_run_command
    self.bitfields_variable()
  File
"/home/daniel/dev/llvm-svn/tools/lldb/test/lang/c/bitfields/TestBitfields.py",
line 111, in bitfields_variable
    '(uint8_t:1) d = \'\\0\''])
  File "/home/daniel/dev/llvm-svn/tools/lldb/test/lldbtest.py", line 1325, in
expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Variable(s) displayed correctly
Config=x86_64-clang

Daniel Malea changed bug 15260

What Removed Added
Status NEW RESOLVED
Resolution INVALID

Comment # 5 on bug 15260 from Daniel Malea

My bad; it seems C99 section 6.7.8 also says that unnamed bitfields have
indeterminate value and are not initialized...

This bug is invalid after all, the testcase was just broken.

I committed Filipe's patch to fix the invalid testcase in 175666.