[Lldb-commits] [lldb] 3bc65a9 - Handle a LC_NOTE main bin spec for user process corefiles

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 24 02:23:13 PDT 2021


Author: Jason Molenda
Date: 2021-03-24T02:18:17-07:00
New Revision: 3bc65a946ebef55cee2d1e151977a570d32a2b23

URL: https://github.com/llvm/llvm-project/commit/3bc65a946ebef55cee2d1e151977a570d32a2b23
DIFF: https://github.com/llvm/llvm-project/commit/3bc65a946ebef55cee2d1e151977a570d32a2b23.diff

LOG: Handle a LC_NOTE main bin spec for user process corefiles

I was playing around with main bin spec LC_NOTEs and noticed
a small oversight in the parsing of user process corefile notes.

Added: 
    

Modified: 
    lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index 0f771106401c..82a946f93206 100644
--- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -285,14 +285,16 @@ Status ProcessMachCore::DoLoadCore() {
   ObjectFile::BinaryType type;
   if (core_objfile->GetCorefileMainBinaryInfo(objfile_binary_addr,
                                               objfile_binary_uuid, type)) {
-    if (objfile_binary_addr != LLDB_INVALID_ADDRESS)
-    {
+    if (objfile_binary_addr != LLDB_INVALID_ADDRESS) {
+      if (type == ObjectFile::eBinaryTypeUser)
+        m_dyld_addr = objfile_binary_addr;
+      else
         m_mach_kernel_addr = objfile_binary_addr;
-        found_main_binary_definitively = true;
-        LLDB_LOGF(log,
-                  "ProcessMachCore::DoLoadCore: using kernel address 0x%" PRIx64
-                  " from LC_NOTE 'main bin spec' load command.",
-                  m_mach_kernel_addr);
+      found_main_binary_definitively = true;
+      LLDB_LOGF(log,
+                "ProcessMachCore::DoLoadCore: using kernel address 0x%" PRIx64
+                " from LC_NOTE 'main bin spec' load command.",
+                m_mach_kernel_addr);
     }
   }
 


        


More information about the lldb-commits mailing list