@@ -266,6 +266,16 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints (Process *process)
266
266
{
267
267
return addr;
268
268
}
269
+ addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000002010ULL , 8 , LLDB_INVALID_ADDRESS, read_err);
270
+ if (CheckForKernelImageAtAddress (addr, process).IsValid ())
271
+ {
272
+ return addr;
273
+ }
274
+ addr = process->ReadUnsignedIntegerFromMemory (0xfffffff000004010ULL , 8 , LLDB_INVALID_ADDRESS, read_err);
275
+ if (CheckForKernelImageAtAddress (addr, process).IsValid ())
276
+ {
277
+ return addr;
278
+ }
269
279
}
270
280
else
271
281
{
@@ -397,9 +407,13 @@ DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch (Process *process)
397
407
lldb_private::UUID
398
408
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, Process *process)
399
409
{
410
+ Log *log (lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER));
400
411
if (addr == LLDB_INVALID_ADDRESS)
401
412
return UUID ();
402
413
414
+ if (log )
415
+ log ->Printf (" DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: looking for kernel binary at 0x%" PRIx64, addr);
416
+
403
417
// First try a quick test -- read the first 4 bytes and see if there is a valid Mach-O magic field there
404
418
// (the first field of the mach_header/mach_header_64 struct).
405
419
@@ -450,6 +464,8 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress (lldb::addr_t addr, Proc
450
464
{
451
465
process->GetTarget ().SetArchitecture (kernel_arch);
452
466
}
467
+ if (log )
468
+ log ->Printf (" DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: kernel binary image found at 0x%" PRIx64, addr);
453
469
return memory_module_sp->GetUUID ();
454
470
}
455
471
}
0 commit comments