[Lldb-commits] [lldb] Don't cause a premature UpdateIfNeeded when checking in SBValue::GetSP (PR #80222)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 1 09:07:57 PST 2024


================
@@ -114,21 +114,26 @@ class ValueImpl {
     lldb::ValueObjectSP value_sp = m_valobj_sp;
 
     Target *target = value_sp->GetTargetSP().get();
-    // If this ValueObject holds an error, then it is valuable for that.
-    if (value_sp->GetError().Fail())
-      return value_sp;
-
-    if (!target)
+    if (!target) {
+      // If we can't get the target, the error might still be useful:
+      if (value_sp->CheckError().Fail())
+        return value_sp;      
----------------
adrian-prantl wrote:

Doesn't whatever call site this is returned to now also need to call the new non-updating API to surface it to the user?

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


More information about the lldb-commits mailing list