summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-07-10 01:23:25 +0000
committerGreg Clayton <gclayton@apple.com>2013-07-10 01:23:25 +0000
commit3046e668301ec9df4ead087fdc906877b9dcbf82 (patch)
treeff149c296cddf3415649f2571282ef53b3554fbd /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
parent8978a9dd0a42139809f56b6df47a0663f341918b (diff)
downloadbcm5719-llvm-3046e668301ec9df4ead087fdc906877b9dcbf82.tar.gz
bcm5719-llvm-3046e668301ec9df4ead087fdc906877b9dcbf82.zip
Cleanup on the unified section list changes. Main changes are:
- ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags - Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections. Other cleanups: - Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly - Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently - Modified the Symtab class to store a file address lookup table for more efficient lookups - Removed Section::Finalize() and SectionList::Finalize() as they did nothing - Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs - Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement) llvm-svn: 185990
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index ec1aef784c2..7afcd6f49a7 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -511,7 +511,7 @@ ObjectFilePECOFF::GetSectionName(std::string& sect_name, const section_header_t&
// GetNListSymtab
//----------------------------------------------------------------------
Symtab *
-ObjectFilePECOFF::GetSymtab(uint32_t flags)
+ObjectFilePECOFF::GetSymtab()
{
ModuleSP module_sp(GetModule());
if (module_sp)
@@ -597,16 +597,26 @@ ObjectFilePECOFF::GetSymtab(uint32_t flags)
}
-SectionList *
-ObjectFilePECOFF::GetSectionList()
+bool
+ObjectFilePECOFF::IsStripped ()
{
- ModuleSP module_sp(GetModule());
- if (module_sp)
+ // TODO: determine this for COFF
+ return false;
+}
+
+
+
+void
+ObjectFilePECOFF::CreateSections (SectionList &unified_section_list)
+{
+ if (!m_sections_ap.get())
{
- lldb_private::Mutex::Locker locker(module_sp->GetMutex());
- if (m_sections_ap.get() == NULL)
+ m_sections_ap.reset(new SectionList());
+
+ ModuleSP module_sp(GetModule());
+ if (module_sp)
{
- m_sections_ap.reset(new SectionList());
+ lldb_private::Mutex::Locker locker(module_sp->GetMutex());
const uint32_t nsects = m_sect_headers.size();
ModuleSP module_sp (GetModule());
for (uint32_t idx = 0; idx<nsects; ++idx)
@@ -710,13 +720,11 @@ ObjectFilePECOFF::GetSectionList()
//section_sp->SetIsEncrypted (segment_is_encrypted);
- m_sections_ap->AddSection(section_sp);
+ unified_section_list.AddSection(section_sp);
+ m_sections_ap->AddSection (section_sp);
}
-
- m_sections_ap->Finalize(); // Now that we're done adding sections, finalize to build fast-lookup caches
}
}
- return m_sections_ap.get();
}
bool
@@ -754,8 +762,9 @@ ObjectFilePECOFF::Dump(Stream *s)
*s << ", file = '" << m_file << "', arch = " << header_arch.GetArchitectureName() << "\n";
- if (m_sections_ap.get())
- m_sections_ap->Dump(s, NULL, true, UINT32_MAX);
+ SectionList *sections = GetSectionList();
+ if (sections)
+ sections->Dump(s, NULL, true, UINT32_MAX);
if (m_symtab_ap.get())
m_symtab_ap->Dump(s, NULL, eSortOrderNone);
OpenPOWER on IntegriCloud