[Lldb-commits] [PATCH] D38492: [lldb] Fix initialization of m_debug_cu_index_map

Alexander Shaposhnikov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 3 12:58:06 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL314832: [lldb] Fix initialization of m_debug_cu_index_map (authored by alexshap).

Changed prior to commit:
  https://reviews.llvm.org/D38492?vs=117470&id=117570#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38492

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
@@ -69,17 +69,21 @@
       debug_cu_index.GetAddressByteSize());
   if (!dwp_symfile->m_debug_cu_index.parse(llvm_debug_cu_index))
     return nullptr;
+  dwp_symfile->InitDebugCUIndexMap();
   return dwp_symfile;
 }
 
-SymbolFileDWARFDwp::SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
-                                       lldb::ObjectFileSP obj_file)
-    : m_obj_file(std::move(obj_file)), m_debug_cu_index(llvm::DW_SECT_INFO) {
-  for (const auto &entry : m_debug_cu_index.getRows()) {
+void SymbolFileDWARFDwp::InitDebugCUIndexMap() {
+  m_debug_cu_index_map.clear();
+  for (const auto &entry : m_debug_cu_index.getRows())
     m_debug_cu_index_map.emplace(entry.getSignature(), &entry);
-  }
 }
 
+SymbolFileDWARFDwp::SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
+                                       lldb::ObjectFileSP obj_file)
+    : m_obj_file(std::move(obj_file)), m_debug_cu_index(llvm::DW_SECT_INFO) 
+{}
+
 std::unique_ptr<SymbolFileDWARFDwo>
 SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu,
                                           uint64_t dwo_id) {
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
@@ -40,6 +40,8 @@
 
   bool LoadRawSectionData(lldb::SectionType sect_type,
                           lldb_private::DWARFDataExtractor &data);
+  
+  void InitDebugCUIndexMap();
 
   lldb::ObjectFileSP m_obj_file;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38492.117570.patch
Type: text/x-patch
Size: 1867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171003/77dbb5d9/attachment.bin>


More information about the lldb-commits mailing list