[LLDB] Fix the handling of unnamed bit-fields when parsing DWARF
authorshafik <syaghmour@apple.com>
Thu, 23 Jan 2020 22:42:12 +0000 (14:42 -0800)
committershafik <syaghmour@apple.com>
Thu, 23 Jan 2020 22:46:24 +0000 (14:46 -0800)
commitfcaf5f6c01a09f23b948afb8c91c4dd951d4525e
treec492ebce18f49f121c79c7d8d0a26e610a13fd0d
parent765b37abdfc037746bf51c43bcb1b8785b6639f0
[LLDB] Fix the handling of unnamed bit-fields when parsing DWARF

We ran into an assert when debugging clang and performing an expression on a class derived from DeclContext. The assert was indicating we were getting the offsets wrong for RecordDeclBitfields. We were getting both the size and offset of unnamed bit-field members wrong. We could fix this case with a quick change but as I extended the test suite to include more combinations we kept finding more cases that were being handled incorrectly. A fix that handled all the new cases as well as the cases already covered required a refactor of the existing technique.

Differential Revision: https://reviews.llvm.org/D72953
lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/TestCppBitfields.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/bitfields/main.cpp [new file with mode: 0644]
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h