[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
Fri Sep 13 10:16:43 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);
----------------
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
More information about the lldb-commits
mailing list