[Lldb-commits] [lldb] r247671 - Fix several issues arount dwo symbol file handling

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 15 03:33:41 PDT 2015


Author: tberghammer
Date: Tue Sep 15 05:33:41 2015
New Revision: 247671

URL: http://llvm.org/viewvc/llvm-project?rev=247671&view=rev
Log:
Fix several issues arount dwo symbol file handling

Differential revision: http://reviews.llvm.org/D12804

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp?rev=247671&r1=247670&r2=247671&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp Tue Sep 15 05:33:41 2015
@@ -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;
     }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=247671&r1=247670&r2=247671&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue Sep 15 05:33:41 2015
@@ -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

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp?rev=247671&r1=247670&r2=247671&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp Tue Sep 15 05:33:41 2015
@@ -23,6 +23,7 @@ SymbolFileDWARFDwo::SymbolFileDWARFDwo(O
     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(
 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();
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h?rev=247671&r1=247670&r2=247671&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h Tue Sep 15 05:33:41 2015
@@ -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;
 };




More information about the lldb-commits mailing list