[Lldb-commits] [lldb] ValueImpl::GetSP was calling GetError before acquiring the StopLocker. (PR #225976)

Will Hawkins via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 26 00:32:50 PDT 2026


================
@@ -3909,9 +3912,20 @@ lldb::ValueObjectSP ValueImpl::GetSP(Process::StopLocker &stop_locker,
     // is running. If you want to look at values, pause the process, then
     // look.
     error = Status::FromErrorString("process must be stopped.");
+    // We still want to return a value object if it was in an error state, but
+    // we can't call GetError here, since that would call UpdateValueIfNeeded
+    // which isn't safe to do without holding the stop locker.
+    if (value_sp->PeekError().Fail())
+      return value_sp;
+
     return ValueObjectSP();
   }
 
+  // Now we can safely get the ValueObject to update itself and if that results
+  // in an error, return this ValueObject since it holds the error:
----------------
hawkinsw wrote:

```suggestion
  // in an error, return this ValueObject because it holds the error:
```

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


More information about the lldb-commits mailing list