File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,12 @@ DynamicLoader::GetSectionListFromModule(const ModuleSP module) const {
157
157
ModuleSP DynamicLoader::FindModuleViaTarget (const FileSpec &file) {
158
158
Target &target = m_process->GetTarget ();
159
159
ModuleSpec module_spec (file, target.GetArchitecture ());
160
+ ModuleSpec module_spec_from_process;
161
+ // Process may be able to augment the module_spec with UUID, e.g. ELF core.
162
+ if (m_process->GetModuleSpec (file, target.GetArchitecture (),
163
+ module_spec_from_process)) {
164
+ module_spec = module_spec_from_process;
165
+ }
160
166
161
167
if (ModuleSP module_sp = target.GetImages ().FindFirstModule (module_spec))
162
168
return module_sp;
Original file line number Diff line number Diff line change @@ -286,6 +286,22 @@ void ProcessElfCore::UpdateBuildIdForNTFileEntries() {
286
286
}
287
287
}
288
288
289
+ bool ProcessElfCore::GetModuleSpec (const FileSpec &module_file_spec,
290
+ const ArchSpec &arch,
291
+ ModuleSpec &module_spec) {
292
+ module_spec.Clear ();
293
+ for (NT_FILE_Entry &entry : m_nt_file_entries) {
294
+ if (module_file_spec.GetPath () == entry.path ) {
295
+ module_spec.GetFileSpec () = module_file_spec;
296
+ module_spec.GetArchitecture () = arch;
297
+ module_spec.GetUUID () = entry.uuid ;
298
+ return true ;
299
+ }
300
+ }
301
+
302
+ return false ;
303
+ }
304
+
289
305
lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader () {
290
306
if (m_dyld_up.get () == nullptr )
291
307
m_dyld_up.reset (DynamicLoader::FindPlugin (
Original file line number Diff line number Diff line change @@ -163,6 +163,10 @@ class ProcessElfCore : public lldb_private::PostMortemProcess {
163
163
// Populate gnu uuid for each NT_FILE entry
164
164
void UpdateBuildIdForNTFileEntries ();
165
165
166
+ bool GetModuleSpec (const lldb_private::FileSpec &module_file_spec,
167
+ const lldb_private::ArchSpec &arch,
168
+ lldb_private::ModuleSpec &module_spec) override ;
169
+
166
170
// Returns the value of certain type of note of a given start address
167
171
lldb_private::UUID FindBuidIdInCoreMemory (lldb::addr_t address);
168
172
You can’t perform that action at this time.
0 commit comments