================
@@ -218,10 +230,16 @@ lldb_private::UUID 
DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress(
     return UUID();
   }
 
-  // In here, I should check is_kernel for memory_module_sp
-  // However, the ReadModuleFromMemory reads wrong section so that this check
-  // will failed
-  ArchSpec kernel_arch(llvm::ELF::convertEMachineToArchName(header.e_machine));
+  // Because the memory module is read from memory and in the memory, the type
+  // is eTypeExecutable so we have to assign the type manually
+  memory_module_sp->GetObjectFile()->SetType(ObjectFile::eTypeCoreFile);
+
+  if (memory_module_sp->GetUUID() !=
+      process->GetTarget().GetExecutableModule()->GetUUID()) {
+    LLDB_LOGF(log, "DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress "
----------------
DavidSpickett wrote:

Yes that sounds good.

"Cannot match" to me reads as many possible reasons like we couldn't read the 
ID from one of the files, it was in the wrong format, whatever. So I prefer 
what you've suggested.

https://github.com/llvm/llvm-project/pull/80785
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to