diff options
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Core/Module.cpp | 11 | ||||
| -rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/Symbol/SymbolVendor.cpp | 21 | ||||
| -rw-r--r-- | lldb/source/Symbol/Symtab.cpp | 7 |
4 files changed, 51 insertions, 0 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 225bb6d516a..6f16ada4982 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1327,6 +1327,17 @@ Module::GetSectionList() return m_sections_ap.get(); } +void +Module::SectionFileAddressesChanged () +{ + ObjectFile *obj_file = GetObjectFile (); + if (obj_file) + obj_file->SectionFileAddressesChanged (); + SymbolVendor* sym_vendor = GetSymbolVendor(); + if (sym_vendor) + sym_vendor->SectionFileAddressesChanged (); +} + SectionList * Module::GetUnifiedSectionList() { diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index fda38ea3bf1..8d7fe047544 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -1249,6 +1249,8 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list) offset = load_cmd_offset + encryption_cmd.cmdsize; } + bool section_file_addresses_changed = false; + offset = MachHeaderSizeFromMagic(m_header.magic); struct segment_command_64 load_cmd; @@ -1377,6 +1379,10 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list) // where this code path will be taken will not have eh_frame sections. unified_section_sp->SetFileAddress(load_cmd.vmaddr); + + // Notify the module that the section addresses have been changed once + // we're done so any file-address caches can be updated. + section_file_addresses_changed = true; } } m_sections_ap->AddSection(unified_section_sp); @@ -1669,6 +1675,12 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list) offset = load_cmd_offset + load_cmd.cmdsize; } + + + if (section_file_addresses_changed && module_sp.get()) + { + module_sp->SectionFileAddressesChanged(); + } } } diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index 91cb94cdc06..a3f4104016e 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -468,6 +468,27 @@ SymbolVendor::ClearSymtab() } } +void +SymbolVendor::SectionFileAddressesChanged () +{ + ModuleSP module_sp(GetModule()); + if (module_sp) + { + ObjectFile *module_objfile = module_sp->GetObjectFile (); + if (m_sym_file_ap.get()) + { + ObjectFile *symfile_objfile = m_sym_file_ap->GetObjectFile (); + if (symfile_objfile != module_objfile) + symfile_objfile->SectionFileAddressesChanged (); + } + Symtab *symtab = GetSymtab (); + if (symtab) + { + symtab->SectionFileAddressesChanged (); + } + } +} + //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index 507271f64eb..907072c0d90 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -78,6 +78,13 @@ Symtab::GetNumSymbols() const } void +Symtab::SectionFileAddressesChanged () +{ + m_name_to_index.Clear(); + m_file_addr_to_index_computed = false; +} + +void Symtab::Dump (Stream *s, Target *target, SortOrder sort_order) { Mutex::Locker locker (m_mutex); |

