[Lldb-commits] [lldb] [lldb][windows] Null-check m_session_data in ProcessDebugger::OnDebuggerError (PR #199028)

via lldb-commits lldb-commits at lists.llvm.org
Thu May 21 06:49:08 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

<details>
<summary>Changes</summary>

Add a null check that logs and returns, matching the pattern in OnExitProcess.

---
Full diff: https://github.com/llvm/llvm-project/pull/199028.diff


1 Files Affected:

- (modified) lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp (+7) 


``````````diff
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
index 51b2dfcb74d86..dfc4db6665852 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
@@ -549,6 +549,13 @@ void ProcessDebugger::OnDebuggerError(const Status &error, uint32_t type) {
   llvm::sys::ScopedLock lock(m_mutex);
   Log *log = GetLog(WindowsLog::Process);
 
+  if (!m_session_data) {
+    LLDB_LOG(log,
+             "OnDebuggerError called with no active session: error {0}: {1}",
+             error.GetError(), error);
+    return;
+  }
+
   if (m_session_data->m_initial_stop_received) {
     // This happened while debugging.  Do we shutdown the debugging session,
     // try to continue, or do something else?

``````````

</details>


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


More information about the lldb-commits mailing list