Adjust a ValueObjectChild's offset when the child is a bitfield
authorAdrian Prantl <aprantl@apple.com>
Wed, 7 Aug 2019 22:40:05 +0000 (22:40 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 7 Aug 2019 22:40:05 +0000 (22:40 +0000)
commitf81d6fe75ca17bd3a5153a0d7bae853b977c5ea2
treeb281b31107e46a444e73d030037061121327fbcf
parentbeb5150f478d4b9f25bb300430f21dedc0c3b9e4
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
lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
lldb/source/Core/ValueObjectChild.cpp