[Lldb-commits] [PATCH] D30454: [LLDB][MIPS] Regain Module Name if memory_info.GetName() is empty

Nitesh Jain via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 15 01:31:28 PDT 2017

nitesh.jain updated this revision to Diff 91833.
nitesh.jain retitled this revision from "[LLDB][MIPS] Fix typo in MatchesModuleSpec()" to "[LLDB][MIPS] Regain Module Name if memory_info.GetName()  is empty".
nitesh.jain added a comment.

In case of debugging normal process, the memory_info.GetName() is not empty and hence module is read from memory (m_process->ReadModuleFromMemory) and the corresponding sections are updated. In case of core file , the memory_info.GetName() is empty which causes FindFirstModule to matches with the first module in ModuleSpecList and result in loading wrong module at incorrect sections addresses. This patch regain "vdso" module name if  memory_info.GetName() is empty.



Index: source/Core/DynamicLoader.cpp
--- source/Core/DynamicLoader.cpp
+++ source/Core/DynamicLoader.cpp
@@ -190,6 +190,10 @@
     Error error = m_process->GetMemoryRegionInfo(base_addr, memory_info);
     if (error.Success() && memory_info.GetMapped() &&
         memory_info.GetRange().GetRangeBase() == base_addr) {
+      // Regain name if memory_info.GetName is empty
+      if (memory_info.GetName().IsEmpty())
+        memory_info.SetName(file.GetFilename().AsCString());
       ModuleSpec new_module_spec(
           FileSpec(memory_info.GetName().AsCString(), false),

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30454.91833.patch
Type: text/x-patch
Size: 688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170315/f42f44e4/attachment.bin>

More information about the lldb-commits mailing list