================
@@ -1121,6 +1121,96 @@ class ValueObject {
const ValueObject &operator=(const ValueObject &) = delete;
};
+// The two classes below are used by the public SBValue API implementation.
This
+// is useful here because we need them in order to access the underlying
+// ValueObject from SBValue without introducing a back-dependency from the API
+// library to the more core libs.
+
+class ValueImpl {
+public:
+ ValueImpl() = default;
+
+ ValueImpl(lldb::ValueObjectSP in_valobj_sp,
+ lldb::DynamicValueType use_dynamic, bool use_synthetic,
+ const char *name = nullptr);
+
+ ValueImpl(const ValueImpl &rhs) = default;
+
+ ValueImpl &operator=(const ValueImpl &rhs);
+
+ bool IsValid();
+
+ lldb::ValueObjectSP GetRootSP() { return m_valobj_sp; }
+
+ lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker,
+ std::unique_lock<std::recursive_mutex> &lock,
+ Status &error);
+
+ void SetUseDynamic(lldb::DynamicValueType use_dynamic) {
+ m_use_dynamic = use_dynamic;
+ }
+
+ void SetUseSynthetic(bool use_synthetic) { m_use_synthetic = use_synthetic; }
+
+ lldb::DynamicValueType GetUseDynamic() { return m_use_dynamic; }
+
+ bool GetUseSynthetic() { return m_use_synthetic; }
+
+ // All the derived values that we would make from the m_valobj_sp will share
+ // the ExecutionContext with m_valobj_sp, so we don't need to do the
+ // calculations in GetSP to return the Target, Process, Thread or Frame. It
+ // is convenient to provide simple accessors for these, which I do here.
+ lldb::TargetSP GetTargetSP() {
+ if (m_valobj_sp)
+ return m_valobj_sp->GetTargetSP();
+ else
----------------
JDevlieghere wrote:
Since you're touching this, can you remove the `else-after-return`s?
https://github.com/llvm/llvm-project/pull/178573
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits