shafik created this revision. shafik added reviewers: aprantl, teemperor, labath. shafik requested review of this revision.
We have a bug in which using `member_clang_type.GetByteSize()` triggers record layout and during this process since the record was not yet complete we ended up reaching a record that had not been layed out yet. Using `member_type->GetByteSize() ` avoids this situation since it relies on size from DWARF and will not trigger record layout. We were not able to reduce this to minimal reproducer. The crash goes away in this case when we have a dSYM and we have seen that ordering in symbol processing can change the behavior as well. For reference: rdar://77293040 https://reviews.llvm.org/D102445 Files: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2671,7 +2671,7 @@ last_field_info.bit_offset = field_bit_offset; if (llvm::Optional<uint64_t> clang_type_size = - member_clang_type.GetByteSize(nullptr)) { + member_type->GetByteSize(nullptr)) { last_field_info.bit_size = *clang_type_size * character_width; }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2671,7 +2671,7 @@ last_field_info.bit_offset = field_bit_offset; if (llvm::Optional<uint64_t> clang_type_size = - member_clang_type.GetByteSize(nullptr)) { + member_type->GetByteSize(nullptr)) { last_field_info.bit_size = *clang_type_size * character_width; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits