This revision was automatically updated to reflect the committed changes.
Closed by commit rL320705: ObjectFile: remove 
ReadSectionData/MemoryMapSectionData mutual recursion (authored by labath, 
committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D41169?vs=126723&id=126949#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D41169

Files:
  lldb/trunk/include/lldb/Symbol/ObjectFile.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Symbol/ObjectFile.cpp


Index: lldb/trunk/source/Symbol/ObjectFile.cpp
===================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp
+++ lldb/trunk/source/Symbol/ObjectFile.cpp
@@ -561,25 +561,9 @@
   } else {
     // The object file now contains a full mmap'ed copy of the object file 
data,
     // so just use this
-    return MemoryMapSectionData(section, section_data);
-  }
-}
-
-size_t ObjectFile::MemoryMapSectionData(Section *section,
-                                        DataExtractor &section_data) {
-  // If some other objectfile owns this data, pass this to them.
-  if (section->GetObjectFile() != this)
-    return section->GetObjectFile()->MemoryMapSectionData(section,
-                                                          section_data);
-
-  if (IsInMemory()) {
-    return ReadSectionData(section, section_data);
-  } else {
     if (!section->IsRelocated())
       RelocateSection(section);
 
-    // The object file now contains a full mmap'ed copy of the object file 
data,
-    // so just use this
     return GetData(section->GetFileOffset(), section->GetFileSize(),
                    section_data);
   }
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -444,10 +444,8 @@
     Section *section =
         section_list->FindSectionByName(GetDWARFMachOSegmentName()).get();
 
-    // Memory map the DWARF mach-o segment so we have everything mmap'ed
-    // to keep our heap memory usage down.
     if (section)
-      m_obj_file->MemoryMapSectionData(section, m_dwarf_data);
+      m_obj_file->ReadSectionData(section, m_dwarf_data);
   }
 
   get_apple_names_data();
Index: lldb/trunk/include/lldb/Symbol/ObjectFile.h
===================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h
@@ -805,9 +805,6 @@
   virtual size_t ReadSectionData(Section *section,
                                  DataExtractor &section_data);
 
-  size_t MemoryMapSectionData(Section *section,
-                              DataExtractor &section_data);
-
   bool IsInMemory() const { return m_memory_addr != LLDB_INVALID_ADDRESS; }
 
   // Strip linker annotations (such as @@VERSION) from symbol names.


Index: lldb/trunk/source/Symbol/ObjectFile.cpp
===================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp
+++ lldb/trunk/source/Symbol/ObjectFile.cpp
@@ -561,25 +561,9 @@
   } else {
     // The object file now contains a full mmap'ed copy of the object file data,
     // so just use this
-    return MemoryMapSectionData(section, section_data);
-  }
-}
-
-size_t ObjectFile::MemoryMapSectionData(Section *section,
-                                        DataExtractor &section_data) {
-  // If some other objectfile owns this data, pass this to them.
-  if (section->GetObjectFile() != this)
-    return section->GetObjectFile()->MemoryMapSectionData(section,
-                                                          section_data);
-
-  if (IsInMemory()) {
-    return ReadSectionData(section, section_data);
-  } else {
     if (!section->IsRelocated())
       RelocateSection(section);
 
-    // The object file now contains a full mmap'ed copy of the object file data,
-    // so just use this
     return GetData(section->GetFileOffset(), section->GetFileSize(),
                    section_data);
   }
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -444,10 +444,8 @@
     Section *section =
         section_list->FindSectionByName(GetDWARFMachOSegmentName()).get();
 
-    // Memory map the DWARF mach-o segment so we have everything mmap'ed
-    // to keep our heap memory usage down.
     if (section)
-      m_obj_file->MemoryMapSectionData(section, m_dwarf_data);
+      m_obj_file->ReadSectionData(section, m_dwarf_data);
   }
 
   get_apple_names_data();
Index: lldb/trunk/include/lldb/Symbol/ObjectFile.h
===================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h
@@ -805,9 +805,6 @@
   virtual size_t ReadSectionData(Section *section,
                                  DataExtractor &section_data);
 
-  size_t MemoryMapSectionData(Section *section,
-                              DataExtractor &section_data);
-
   bool IsInMemory() const { return m_memory_addr != LLDB_INVALID_ADDRESS; }
 
   // Strip linker annotations (such as @@VERSION) from symbol names.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to