summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-09-15 10:33:41 +0000
committerTamas Berghammer <tberghammer@google.com>2015-09-15 10:33:41 +0000
commitd536a6d9dc1397dcad4da088b77d6048dd7c3d87 (patch)
tree38348f870f43de7f4b73b79c5c67ff01fd618ed2
parent7beb737b46e03d4b2b508df9ec2da93805fb5ef8 (diff)
downloadbcm5719-llvm-d536a6d9dc1397dcad4da088b77d6048dd7c3d87.tar.gz
bcm5719-llvm-d536a6d9dc1397dcad4da088b77d6048dd7c3d87.zip
Fix several issues arount dwo symbol file handling
Differential revision: http://reviews.llvm.org/D12804 llvm-svn: 247671
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp7
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp23
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h6
4 files changed, 30 insertions, 8 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
index f26b51c1eeb..dbdb42c9ddc 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -186,8 +186,11 @@ DWARFDIE::GetID () const
if (m_cu)
{
- assert ((id&0xffffffff00000000ull) == 0 || m_cu->GetOffset() == 0);
- id |= ((lldb::user_id_t)m_cu->GetOffset()) << 32;
+ lldb::user_id_t cu_id = ((lldb::user_id_t)m_cu->GetID())<<32;
+ assert ((id&0xffffffff00000000ull) == 0 ||
+ (cu_id&0xffffffff00000000ll) == 0 ||
+ (id&0xffffffff00000000ull) == (cu_id&0xffffffff00000000ll));
+ id |= cu_id;
}
return id;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index ad1cc760959..5dacfcc5946 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -433,7 +433,7 @@ protected:
bool include_inlines,
lldb_private::SymbolContextList& sc_list);
- lldb::TypeSP
+ virtual lldb::TypeSP
FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &die_decl_ctx);
lldb::TypeSP
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index 5b0ac9a47b7..720c437327c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -23,6 +23,7 @@ SymbolFileDWARFDwo::SymbolFileDWARFDwo(ObjectFileSP objfile, DWARFCompileUnit* d
m_obj_file_sp(objfile),
m_base_dwarf_cu(dwarf_cu)
{
+ SetID(((lldb::user_id_t)dwarf_cu->GetOffset())<<32);
}
const lldb_private::DWARFDataExtractor&
@@ -63,7 +64,7 @@ lldb::CompUnitSP
SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit* dwarf_cu, uint32_t cu_idx)
{
assert(GetCompileUnit() == dwarf_cu && "SymbolFileDWARFDwo::ParseCompileUnit called with incompatible compile unit");
- return m_base_dwarf_cu->GetSymbolFileDWARF()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX);
+ return GetBaseSymbolFile()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX);
}
DWARFCompileUnit*
@@ -85,23 +86,35 @@ SymbolFileDWARFDwo::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit)
SymbolFileDWARF::DIEToTypePtr&
SymbolFileDWARFDwo::GetDIEToType()
{
- return m_base_dwarf_cu->GetSymbolFileDWARF()->GetDIEToType();
+ return GetBaseSymbolFile()->GetDIEToType();
}
SymbolFileDWARF::DIEToVariableSP&
SymbolFileDWARFDwo::GetDIEToVariable()
{
- return m_base_dwarf_cu->GetSymbolFileDWARF()->GetDIEToVariable();
+ return GetBaseSymbolFile()->GetDIEToVariable();
}
SymbolFileDWARF::DIEToClangType&
SymbolFileDWARFDwo::GetForwardDeclDieToClangType()
{
- return m_base_dwarf_cu->GetSymbolFileDWARF()->GetForwardDeclDieToClangType();
+ return GetBaseSymbolFile()->GetForwardDeclDieToClangType();
}
SymbolFileDWARF::ClangTypeToDIE&
SymbolFileDWARFDwo::GetForwardDeclClangTypeToDie()
{
- return m_base_dwarf_cu->GetSymbolFileDWARF()->GetForwardDeclClangTypeToDie();
+ return GetBaseSymbolFile()->GetForwardDeclClangTypeToDie();
+}
+
+lldb::TypeSP
+SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &die_decl_ctx)
+{
+ return GetBaseSymbolFile()->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
+}
+
+SymbolFileDWARF*
+SymbolFileDWARFDwo::GetBaseSymbolFile()
+{
+ return m_base_dwarf_cu->GetSymbolFileDWARF();
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index 37c9679113f..1b696d74b70 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -51,6 +51,12 @@ protected:
ClangTypeToDIE&
GetForwardDeclClangTypeToDie() override;
+ lldb::TypeSP
+ FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &die_decl_ctx) override;
+
+ SymbolFileDWARF*
+ GetBaseSymbolFile();
+
lldb::ObjectFileSP m_obj_file_sp;
DWARFCompileUnit* m_base_dwarf_cu;
};
OpenPOWER on IntegriCloud