[Lldb-commits] [lldb] [lldb][Darwin] Don't try to insert breakpoint on corefiles (PR #184749)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 4 22:45:34 PST 2026


https://github.com/jasonmolenda created https://github.com/llvm/llvm-project/pull/184749

lldb is printing an error that the kext-loaded notification breakpoint can't be set when debugging a kernel corefile.  The breakpoint only needs to be inserted in live debug sessions.

rdar://170813438

>From 444db01b5a7711d4c447913ca614291017fe271f Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmolenda at apple.com>
Date: Wed, 4 Mar 2026 22:43:30 -0800
Subject: [PATCH] [lldb][Darwin] Don't try to insert breakpoint on corefiles

lldb is printing an error that the kext-loaded notification breakpoint
can't be set when debugging a kernel corefile.  The breakpoint only
needs to be inserted in live debug sessions.

rdar://170813438
---
 .../DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index f89b0fe6b6dbf..4e9b1389a11ab 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -1561,7 +1561,8 @@ void DynamicLoaderDarwinKernel::PrivateInitialize(Process *process) {
 }
 
 void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() {
-  if (m_break_id == LLDB_INVALID_BREAK_ID && m_kernel.GetModule()) {
+  if (m_break_id == LLDB_INVALID_BREAK_ID && m_kernel.GetModule() &&
+      m_process->IsLiveDebugSession()) {
     DEBUG_PRINTF("DynamicLoaderDarwinKernel::%s() process state = %s\n",
                  __FUNCTION__, StateAsCString(m_process->GetState()));
 



More information about the lldb-commits mailing list