[Lldb-commits] [lldb] Avoid expression evaluation in libStdC++ std::vector<bool> synthetic children provider (PR #108414)

via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 12 17:18:17 PDT 2024


================
@@ -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);
----------------
jeffreytan81 wrote:

I copied it from `SBValue::CreateValueFromData()`. I actually do not accurately know its meaning, so simply keep it here for safety purpose. I will remove it since test still succeeds after removing. 



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


More information about the lldb-commits mailing list