diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -123,8 +123,7 @@ /// module within a module (.a files and modules that contain /// multiple architectures). Module( - const FileSpec &file_spec, const ArchSpec &arch, - const ConstString *object_name = nullptr, + const FileSpec &file_spec, const ArchSpec &arch, ConstString object_name, lldb::offset_t object_offset = 0, const llvm::sys::TimePoint<> &object_mod_time = llvm::sys::TimePoint<>()); diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -233,12 +233,12 @@ } Module::Module(const FileSpec &file_spec, const ArchSpec &arch, - const ConstString *object_name, lldb::offset_t object_offset, + ConstString object_name, lldb::offset_t object_offset, const llvm::sys::TimePoint<> &object_mod_time) : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), - m_arch(arch), m_file(file_spec), m_object_offset(object_offset), - m_object_mod_time(object_mod_time), m_file_has_changed(false), - m_first_file_changed_log(false) { + m_arch(arch), m_file(file_spec), m_object_name(object_name), + m_object_offset(object_offset), m_object_mod_time(object_mod_time), + m_file_has_changed(false), m_first_file_changed_log(false) { // Scope for locker below... { std::lock_guard guard( @@ -246,9 +246,6 @@ GetModuleCollection().push_back(this); } - if (object_name) - m_object_name = *object_name; - Log *log(GetLog(LLDBLog::Object | LLDBLog::Modules)); if (log != nullptr) LLDB_LOGF(log, "%p Module::Module((%s) '%s%s%s%s')", diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -802,7 +802,8 @@ kernel_search_error, true)) { if (FileSystem::Instance().Exists(module_spec.GetFileSpec())) { m_module_sp = std::make_shared(module_spec.GetFileSpec(), - target.GetArchitecture()); + target.GetArchitecture(), + ConstString()); } } } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -170,7 +170,7 @@ public: DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx, const FileSpec &file_spec, const ArchSpec &arch, - const ConstString *object_name, off_t object_offset, + const ConstString object_name, off_t object_offset, const llvm::sys::TimePoint<> object_mod_time) : Module(file_spec, arch, object_name, object_offset, object_mod_time), m_exe_module_wp(exe_module_sp), m_cu_idx(cu_idx) {} @@ -459,7 +459,7 @@ .c_str()); comp_unit_info->oso_sp->module_sp = std::make_shared( obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file, - oso_arch, oso_object ? &oso_object : nullptr, 0, + oso_arch, oso_object, 0, oso_object ? comp_unit_info->oso_mod_time : llvm::sys::TimePoint<>()); if (oso_object && !comp_unit_info->oso_sp->module_sp->GetObjectFile() && diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2386,7 +2386,7 @@ "Process::ReadModuleFromMemory reading %s binary from memory", file_spec.GetPath().c_str()); } - ModuleSP module_sp(new Module(file_spec, ArchSpec())); + ModuleSP module_sp(new Module(file_spec, ArchSpec(), ConstString())); if (module_sp) { Status error; ObjectFile *objfile = module_sp->GetMemoryObjectFile( diff --git a/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp b/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp --- a/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp +++ b/lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp @@ -57,7 +57,7 @@ // Test that when we have Dwarf debug info, SymbolFileDWARF is used. FileSpec fspec(m_dwarf_test_exe); ArchSpec aspec("i686-pc-windows"); - lldb::ModuleSP module = std::make_shared(fspec, aspec); + lldb::ModuleSP module = std::make_shared(fspec, aspec, ConstString()); SymbolFile *symfile = module->GetSymbolFile(); ASSERT_NE(nullptr, symfile);