diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-08-07 22:40:05 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-08-07 22:40:05 +0000 |
commit | f81d6fe75ca17bd3a5153a0d7bae853b977c5ea2 (patch) | |
tree | b281b31107e46a444e73d030037061121327fbcf /lldb/packages/Python/lldbsuite/test | |
parent | beb5150f478d4b9f25bb300430f21dedc0c3b9e4 (diff) | |
download | bcm5719-llvm-f81d6fe75ca17bd3a5153a0d7bae853b977c5ea2.tar.gz bcm5719-llvm-f81d6fe75ca17bd3a5153a0d7bae853b977c5ea2.zip |
Adjust a ValueObjectChild's offset when the child is a bitfield
If a bitfield doesn't fit into the child_byte_size'd window at
child_byte_offset, move the window forward until it fits. The problem
here is that Value has no notion of bitfields and thus the Value's
DataExtractor is sized like the bitfields CompilerType; a sequence of
bitfields, however, can be larger than their underlying type.
This was not in the big-endian-derived DWARF 2 bitfield attributes
because their offsets were counted from the end of the window, so they
always fit.
rdar://problem/53132189
Differential Revision: https://reviews.llvm.org/D65492
llvm-svn: 368226
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py | 3 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py index c1a32f2ee09..d5580ac86cc 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py @@ -146,6 +146,9 @@ class BitfieldsTestCase(TestBase): '(uint8_t:1) b17 = \'\\0\'', ]) + self.expect("v/x large_packed", VARIABLES_DISPLAYED_CORRECTLY, + substrs=["a = 0x0000000cbbbbaaaa", "b = 0x0000000dffffeee"]) + @add_test_categories(['pyapi']) # BitFields exhibit crashes in record layout on Windows diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c index c21cfc9a9fb..35faac3b6c3 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c +++ b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c @@ -90,6 +90,14 @@ int main (int argc, char const *argv[]) packed.b = 10; packed.c = 0x7112233; + struct LargePackedBits { + unsigned long a: 36; + unsigned long b: 36; + } __attribute__((packed)); + + struct LargePackedBits large_packed = + (struct LargePackedBits){ 0xcbbbbaaaa, 0xdffffeeee }; + return 0; //// Set break point at this line. } |