From 3046e668301ec9df4ead087fdc906877b9dcbf82 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 10 Jul 2013 01:23:25 +0000 Subject: 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 --- .../Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 37 ++++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp') 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; idxSetIsEncrypted (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); -- cgit v1.2.3