[Lldb-commits] [PATCH] D72953: Fix the handling of unnamed bit-fields when parsing DWARF

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 17 13:17:15 PST 2020


shafik created this revision.
shafik added reviewers: aprantl, teemperor, jingham.

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.

I removed a duplicate of `BitfieldInfo` and renamed `BitfieldInfo` -> `FieldInfo` since it is being used for both bit-fields and non-bit-fields. I extended `TestBitfields.py` to cover five more cases we uncovered while fixing this bug.


https://reviews.llvm.org/D72953

Files:
  lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
  lldb/packages/Python/lldbsuite/test/lang/c/bitfields/main.c
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72953.238861.patch
Type: text/x-patch
Size: 22448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200117/c26e7cfd/attachment-0001.bin>


More information about the lldb-commits mailing list