Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin

to handle the case of an integer constant (DWARF 3 and later).

- Fixes tests that assert in RecordLayoutBuilder::updateExternalFieldOffset
because LLDB was providing an external AST source with missing member offsets.

llvm-svn: 187423
This commit is contained in:
Ashok Thirumurthi 2013-07-30 14:58:39 +00:00
parent 5334ed2d25
commit a4658a5c86
1 changed files with 22 additions and 3 deletions

View File

@ -1780,6 +1780,13 @@ SymbolFileDWARF::ParseChildMembers
member_byte_offset = memberOffset.ResolveValue(NULL).UInt(); member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
} }
} }
else
{
// With DWARF 3 and later, if the value is an integer constant,
// this form value is the offset in bytes from the beginning
// of the containing entity.
member_byte_offset = form_value.Unsigned();
}
break; break;
case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType (form_value.Unsigned()); break; case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType (form_value.Unsigned()); break;
@ -2164,16 +2171,28 @@ SymbolFileDWARF::ParseChildMembers
member_byte_offset = memberOffset.ResolveValue(NULL).UInt(); member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
} }
} }
else
{
// With DWARF 3 and later, if the value is an integer constant,
// this form value is the offset in bytes from the beginning
// of the containing entity.
member_byte_offset = form_value.Unsigned();
}
break; break;
case DW_AT_accessibility: case DW_AT_accessibility:
accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
break; break;
case DW_AT_virtuality: is_virtual = form_value.Boolean(); break; case DW_AT_virtuality:
default: is_virtual = form_value.Boolean();
break;
case DW_AT_sibling: case DW_AT_sibling:
break; break;
default:
break;
} }
} }
} }
@ -2620,7 +2639,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
assert(false && "not a forward clang type decl!"); assert(false && "not a forward clang type decl!");
break; break;
} }
return NULL; return false;
} }
Type* Type*