================
@@ -645,6 +645,23 @@ lldb::SBValue SBValue::CreateValueFromData(const char 
*name, SBData data,
   return sb_value;
 }
 
+lldb::SBValue SBValue::CreateBoolValue(const char *name, bool value) {
+  LLDB_INSTRUMENT_VA(this, name);
+
+  lldb::SBValue sb_value;
+  lldb::ValueObjectSP new_value_sp;
+  ValueLocker locker;
+  lldb::ValueObjectSP value_sp(GetSP(locker));
+  lldb::TargetSP target_sp = m_opaque_sp->GetTargetSP();
+  if (value_sp && target_sp) {
+    new_value_sp =
+        ValueObject::CreateValueObjectFromBool(target_sp, value, name);
+    new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad);
----------------
jimingham wrote:

The problem comes with ValueObjects that live in lldb host memory for instance 
ValueObjectConstResult "history" entities or ValueObject made from 
DataExtractors.  If you have such a result value that includes pointers that 
you copied up from the target memory, even though the ValueObject itself lives 
in lldb host memory, the pointer children still point into the target (are load 
addresses).  This API states that that is true for this ValueObject.

It's not relevant for ValueObjects that can't have pointer children.

https://github.com/llvm/llvm-project/pull/108414
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to