diff options
Diffstat (limited to 'source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
-rw-r--r-- | source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 75977a309..be9a12b62 100644 --- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1218,16 +1218,30 @@ SymbolFileDWARF::ParseChildMembers if (is_artificial == false) { Type *member_type = ResolveTypeUID(encoding_uid); - assert(member_type); - if (accessibility == eAccessNone) - accessibility = default_accessibility; - member_accessibilities.push_back(accessibility); - - GetClangASTContext().AddFieldToRecordType (class_clang_type, - name, - member_type->GetClangLayoutType(), - accessibility, - bit_size); + if (member_type) + { + if (accessibility == eAccessNone) + accessibility = default_accessibility; + member_accessibilities.push_back(accessibility); + + GetClangASTContext().AddFieldToRecordType (class_clang_type, + name, + member_type->GetClangLayoutType(), + accessibility, + bit_size); + } + else + { + if (name) + ReportError ("0x%8.8x: DW_TAG_member '%s' refers to type 0x%8.8x which was unable to be parsed", + die->GetOffset(), + name, + encoding_uid); + else + ReportError ("0x%8.8x: DW_TAG_member refers to type 0x%8.8x which was unable to be parsed", + die->GetOffset(), + encoding_uid); + } } } ++member_idx; @@ -2237,6 +2251,19 @@ SymbolFileDWARF::FindFunctions(const RegularExpression& regex, bool append, Symb // Return the number of variable that were appended to the list return sc_list.GetSize() - original_size; } +void +SymbolFileDWARF::ReportError (const char *format, ...) +{ + ::fprintf (stderr, + "error: %s/%s ", + m_obj_file->GetFileSpec().GetDirectory().GetCString(), + m_obj_file->GetFileSpec().GetFilename().GetCString()); + + va_list args; + va_start (args, format); + vfprintf (stderr, format, args); + va_end (args); +} uint32_t SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types) |