diff options
author | Greg Clayton <gclayton@apple.com> | 2013-07-10 01:23:25 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-07-10 01:23:25 +0000 |
commit | 7baae16d1835c546f0d3750735b5c50b05005699 (patch) | |
tree | a21cc1b0cce8daa61dc129e0597807bde06254ce /lldb/source/Plugins/SymbolVendor | |
parent | a862d2e2cd3831ca70bed1ed2d13dd34ae9afd31 (diff) |
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)
Diffstat (limited to 'lldb/source/Plugins/SymbolVendor')
-rw-r--r-- | lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp | 55 |
2 files changed, 1 insertions, 57 deletions
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp index 2dd2cea6ca9..6500aabdcea 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -141,7 +141,7 @@ SymbolVendorELF::CreateInstance (const lldb::ModuleSP &module_sp, lldb_private:: if (symbol_vendor) { // Get the module unified section list and add our debug sections to that. - SectionList *module_section_list = module_sp->GetUnifiedSectionList(); + SectionList *module_section_list = module_sp->GetSectionList(); SectionList *objfile_section_list = dsym_objfile_sp->GetSectionList(); static const SectionType g_sections[] = @@ -172,7 +172,6 @@ SymbolVendorELF::CreateInstance (const lldb::ModuleSP &module_sp, lldb_private:: module_section_list->AddSection (section_sp); } } - module_section_list->Finalize(); symbol_vendor->AddSymbolFileRepresentation (dsym_objfile_sp); return symbol_vendor; diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index ab8c4e7d5ca..166c4c80ba7 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -83,51 +83,6 @@ UUIDsMatch(Module *module, ObjectFile *ofile, lldb_private::Stream *feedback_str return false; } -static bool -ReplaceDSYMSectionsWithExecutableSections (ObjectFile *exec_objfile, ObjectFile *dsym_objfile) -{ - // We need both the executable and the dSYM to live off of the - // same section lists. So we take all of the sections from the - // executable, and replace them in the dSYM. This allows section - // offset addresses that come from the dSYM to automatically - // get updated as images (shared libraries) get loaded and - // unloaded. - SectionList *exec_section_list = exec_objfile->GetSectionList(); - SectionList *dsym_section_list = dsym_objfile->GetSectionList(); - if (exec_section_list && dsym_section_list) - { - const uint32_t num_exec_sections = dsym_section_list->GetSize(); - uint32_t exec_sect_idx; - for (exec_sect_idx = 0; exec_sect_idx < num_exec_sections; ++exec_sect_idx) - { - SectionSP exec_sect_sp(exec_section_list->GetSectionAtIndex(exec_sect_idx)); - if (exec_sect_sp.get()) - { - // Try and replace any sections that exist in both the executable - // and in the dSYM with those from the executable. If we fail to - // replace the one in the dSYM, then add the executable section to - // the dSYM. - SectionSP dsym_sect_sp(dsym_section_list->FindSectionByID(exec_sect_sp->GetID())); - if (dsym_sect_sp.get() && dsym_sect_sp->GetName() != exec_sect_sp->GetName()) - { - // The sections in a dSYM are normally a superset of the sections in an executable. - // If we find a section # in the exectuable & dSYM that don't have the same name, - // something has changed since the dSYM was written. The mach_kernel DSTROOT binary - // has a CTF segment added, for instance, and it's easiest to simply not add that to - // the dSYM - none of the nlist entries are going to have references to that section. - continue; - } - if (dsym_section_list->ReplaceSection(exec_sect_sp->GetID(), exec_sect_sp, 0) == false) - dsym_section_list->AddSection(exec_sect_sp); - } - } - - dsym_section_list->Finalize(); // Now that we're done adding sections, finalize to build fast-lookup caches - return true; - } - return false; -} - void SymbolVendorMacOSX::Initialize() { @@ -321,16 +276,6 @@ SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp, lldb_privat } } - if (ReplaceDSYMSectionsWithExecutableSections (obj_file, dsym_objfile_sp.get())) - { - SectionList *section_list = dsym_objfile_sp.get()->GetSectionList(); - if (section_list) - { - section_list->Copy (module_sp->GetUnifiedSectionList()); - section_list->Finalize (); - } - } - symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp); return symbol_vendor; } |