diff options
Diffstat (limited to 'source/Symbol/ObjectFile.cpp')
-rw-r--r-- | source/Symbol/ObjectFile.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp index 99f9236a2cd9..62cde26c702f 100644 --- a/source/Symbol/ObjectFile.cpp +++ b/source/Symbol/ObjectFile.cpp @@ -241,8 +241,7 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, lldb::offset_t file_offset, lldb::offset_t length, const lldb::DataBufferSP& data_sp, - lldb::offset_t data_offset -) : + lldb::offset_t data_offset) : ModuleChild (module_sp), m_file (), // This file could be different from the original module's file m_type (eTypeInvalid), @@ -254,7 +253,8 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_process_wp(), m_memory_addr (LLDB_INVALID_ADDRESS), m_sections_ap(), - m_symtab_ap () + m_symtab_ap (), + m_synthetic_symbol_idx (0) { if (file_spec_ptr) m_file = *file_spec_ptr; @@ -286,7 +286,8 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_process_wp (process_sp), m_memory_addr (header_addr), m_sections_ap(), - m_symtab_ap () + m_symtab_ap (), + m_synthetic_symbol_idx (0) { if (header_data_sp) m_data.SetData (header_data_sp, 0, header_data_sp->GetByteSize()); @@ -384,6 +385,11 @@ ObjectFile::GetAddressClass (addr_t file_addr) case eSectionTypeELFDynamicLinkInfo: case eSectionTypeOther: return eAddressClassUnknown; + case eSectionTypeAbsoluteAddress: + // In case of absolute sections decide the address class based on the symbol + // type because the section type isn't specify if it is a code or a data + // section. + break; } } } @@ -545,8 +551,6 @@ ObjectFile::ReadSectionData (const Section *section, DataExtractor& section_data // The object file now contains a full mmap'ed copy of the object file data, so just use this return MemoryMapSectionData (section, section_data); } - section_data.Clear(); - return 0; } size_t @@ -596,7 +600,7 @@ ObjectFile::ClearSymtab () ModuleSP module_sp(GetModule()); if (module_sp) { - lldb_private::Mutex::Locker locker(module_sp->GetMutex()); + std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p ObjectFile::ClearSymtab () symtab = %p", @@ -616,7 +620,7 @@ ObjectFile::GetSectionList(bool update_module_section_list) ModuleSP module_sp(GetModule()); if (module_sp) { - lldb_private::Mutex::Locker locker(module_sp->GetMutex()); + std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex()); CreateSections(*module_sp->GetUnifiedSectionList()); } } @@ -653,3 +657,13 @@ ObjectFile::GetSymbolTypeFromName (llvm::StringRef name, } return symbol_type_hint; } + +ConstString +ObjectFile::GetNextSyntheticSymbolName() +{ + StreamString ss; + ConstString file_name = GetModule()->GetFileSpec().GetFilename(); + ss.Printf("___lldb_unnamed_symbol%u$$%s", ++m_synthetic_symbol_idx, file_name.GetCString()); + return ConstString(ss.GetData()); +} + |