diff options
-rw-r--r-- | lldb/include/lldb/Core/Module.h | 42 | ||||
-rw-r--r-- | lldb/source/Core/Module.cpp | 19 | ||||
-rw-r--r-- | lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp | 3 |
3 files changed, 43 insertions, 21 deletions
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h index 5b38cf9920f..26b489f2f81 100644 --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -49,13 +49,6 @@ public: friend class ModuleList; friend bool ObjectFile::SetModulesArchitecture (const ArchSpec &new_arch); - enum - { - flagsSearchedForObjParser = (1 << 0), - flagsSearchedForSymVendor = (1 << 1), - flagsParsedUUID = (1 << 2) - }; - //------------------------------------------------------------------ /// Construct with file specification and architecture. /// @@ -553,6 +546,18 @@ public: SetFileSpecAndObjectName (const FileSpec &file, const ConstString &object_name); + bool + GetIsDynamicLinkEditor () const + { + return m_is_dynamic_loader_module; + } + + void + SetIsDynamicLinkEditor (bool b) + { + m_is_dynamic_loader_module = b; + } + protected: //------------------------------------------------------------------ // Member Variables @@ -562,10 +567,14 @@ protected: ArchSpec m_arch; ///< The architecture for this module. UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols. FileSpec m_file; ///< The file representation on disk for this module (if there is one). - Flags m_flags; ///< Flags for this module to track what has been parsed already. ConstString m_object_name; ///< The name an object within this module that is selected, or empty of the module is represented by \a m_file. std::auto_ptr<ObjectFile> m_objfile_ap; ///< A pointer to the object file parser for this module. std::auto_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module. + bool m_did_load_objfile:1, + m_did_load_symbol_vendor:1, + m_did_parse_uuid:1, + m_is_dynamic_loader_module:1; + //------------------------------------------------------------------ /// Resolve a file or load virtual address. /// @@ -601,14 +610,21 @@ protected: /// @see SymbolContext::Scope //------------------------------------------------------------------ uint32_t - ResolveSymbolContextForAddress (lldb::addr_t vm_addr, bool vm_addr_is_file_addr, uint32_t resolve_scope, Address& so_addr, SymbolContext& sc); - - void SymbolIndicesToSymbolContextList (Symtab *symtab, std::vector<uint32_t> &symbol_indexes, SymbolContextList &sc_list); + ResolveSymbolContextForAddress (lldb::addr_t vm_addr, + bool vm_addr_is_file_addr, + uint32_t resolve_scope, + Address& so_addr, + SymbolContext& sc); - bool SetArchitecture (const ArchSpec &new_arch); + void + SymbolIndicesToSymbolContextList (Symtab *symtab, + std::vector<uint32_t> &symbol_indexes, + SymbolContextList &sc_list); + + bool + SetArchitecture (const ArchSpec &new_arch); private: - DISALLOW_COPY_AND_ASSIGN (Module); }; diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index ffa80296f3d..b6582193381 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -26,10 +26,13 @@ Module::Module(const FileSpec& file_spec, const ArchSpec& arch, const ConstStrin m_arch (arch), m_uuid (), m_file (file_spec), - m_flags (), m_object_name (), m_objfile_ap (), - m_symfile_ap () + m_symfile_ap (), + m_did_load_objfile (false), + m_did_load_symbol_vendor (false), + m_did_parse_uuid (false), + m_is_dynamic_loader_module (false) { if (object_name) m_object_name = *object_name; @@ -70,14 +73,14 @@ const UUID& Module::GetUUID() { Mutex::Locker locker (m_mutex); - if (m_flags.IsClear(flagsParsedUUID)) + if (m_did_parse_uuid == false) { ObjectFile * obj_file = GetObjectFile (); if (obj_file != NULL) { obj_file->GetUUID(&m_uuid); - m_flags.Set(flagsParsedUUID); + m_did_parse_uuid = true; } } return m_uuid; @@ -330,14 +333,14 @@ SymbolVendor* Module::GetSymbolVendor (bool can_create) { Mutex::Locker locker (m_mutex); - if (m_flags.IsClear(flagsSearchedForSymVendor) && can_create) + if (m_did_load_symbol_vendor == false && can_create) { ObjectFile *obj_file = GetObjectFile (); if (obj_file != NULL) { Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); m_symfile_ap.reset(SymbolVendor::FindPlugin(this)); - m_flags.Set (flagsSearchedForSymVendor); + m_did_load_symbol_vendor = true; } } return m_symfile_ap.get(); @@ -412,9 +415,9 @@ ObjectFile * Module::GetObjectFile() { Mutex::Locker locker (m_mutex); - if (m_flags.IsClear(flagsSearchedForObjParser)) + if (m_did_load_objfile == false) { - m_flags.Set (flagsSearchedForObjParser); + m_did_load_objfile = true; Timer scoped_timer(__PRETTY_FUNCTION__, "Module::GetObjectFile () module = %s", GetFileSpec().GetFilename().AsCString("")); m_objfile_ap.reset(ObjectFile::FindPlugin(this, &m_file, 0, m_file.GetByteSize())); diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index de6a51f7e40..fb65cb716a4 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -601,6 +601,9 @@ DynamicLoaderMacOSXDYLD::UpdateAllImageInfos() if (image_module_sp) { + if (m_dyld_image_infos[idx].header.filetype == HeaderFileTypeDynamicLinkEditor) + image_module_sp->SetIsDynamicLinkEditor (true); + ObjectFile *objfile = image_module_sp->GetObjectFile (); if (objfile) { |