[LLDB] Fix handling of bit-fields in a union

When parsing DWARF and laying out bit-fields we don't properly take into account when they are in a union, they will all have a zero offset.

Differential Revision: https://reviews.llvm.org/D91118
This commit is contained in:
shafik
2020-11-12 11:22:02 -08:00
parent d5e89e8fc1
commit bae9aedb34
3 changed files with 30 additions and 1 deletions

View File

@@ -46,6 +46,16 @@ class CppBitfieldsTestCase(TestBase):
self.expect("expr (clang_example.f.a)", VARIABLES_DISPLAYED_CORRECTLY,
substrs=['uint64_t', '1'])
self.expect("expr uwbf",
substrs=['a = 255',
'b = 65535',
'c = 4294967295',
'x = 4294967295'] )
self.expect("expr uwubf",
substrs=['a = 16777215',
'x = 4294967295'] )
self.expect(
"frame variable --show-types lba",
VARIABLES_DISPLAYED_CORRECTLY,