[Lldb-commits] [lldb] [lldb][Process/FreeBSDKernelCore] Defer actual core loading to DoLoadCore() (PR #186626)

Ed Maste via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 24 05:12:51 PDT 2026


================
@@ -79,9 +78,11 @@ lldb::ProcessSP ProcessFreeBSDKernelCore::CreateInstance(
     kvm_t *kvm =
         kvm_open2(executable->GetFileSpec().GetPath().c_str(),
                   crash_file->GetPath().c_str(), O_RDONLY, nullptr, nullptr);
----------------
emaste wrote:

> my guess is that this kvm_open2 is opening a file descriptor for some /dev/mem and not parsing masses of data to do so

kvm_open* will open /dev/mem for live debugging, or a core file, and do some validation and initialization. It'd be nice to avoid opening it twice, but it's not very expensive.

https://cgit.freebsd.org/src/tree/lib/libkvm/kvm.c#n113
https://cgit.freebsd.org/src/tree/lib/libkvm/kvm_minidump_amd64.c#n120

CC @bsdjhb who maintains our GCC kernel support for comment.

https://github.com/llvm/llvm-project/pull/186626


More information about the lldb-commits mailing list