[Lldb-commits] [lldb] 3641448 - [lldb] Use StopInfoSP instead of	StopInfo* (NFC)
    Jonas Devlieghere via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Fri Jul 18 14:29:27 PDT 2025
    
    
  
Author: Jonas Devlieghere
Date: 2025-07-18T14:29:20-07:00
New Revision: 3641448e08961d8b8621fafa01167f96d948ee9e
URL: https://github.com/llvm/llvm-project/commit/3641448e08961d8b8621fafa01167f96d948ee9e
DIFF: https://github.com/llvm/llvm-project/commit/3641448e08961d8b8621fafa01167f96d948ee9e.diff
LOG: [lldb] Use StopInfoSP instead of StopInfo* (NFC)
Don't make assumptions about the lifetime of the underlying object and
use the shared_ptr to participate in reference counting and extend the
lifetime of the object to the end of the lexical scope.
Added: 
    
Modified: 
    lldb/source/Target/Thread.cpp
Removed: 
    
################################################################################
diff  --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index c68894808eacc..8c3e19725f8cb 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -710,9 +710,8 @@ bool Thread::ShouldResume(StateType resume_state) {
   const uint32_t process_stop_id = GetProcess()->GetStopID();
   if (m_stop_info_stop_id == process_stop_id &&
       (m_stop_info_sp && m_stop_info_sp->IsValid())) {
-    StopInfo *stop_info = GetPrivateStopInfo().get();
-    if (stop_info)
-      stop_info->WillResume(resume_state);
+    if (StopInfoSP stop_info_sp = GetPrivateStopInfo())
+      stop_info_sp->WillResume(resume_state);
   }
 
   // Tell all the plans that we are about to resume in case they need to clear
        
    
    
More information about the lldb-commits
mailing list