diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -102,7 +102,7 @@ /// Shared Pointer to the contained ValueObject, /// just do so by calling GetSP() on the contained object. -class ValueObject : public UserID { +class ValueObject { public: enum GetExpressionPathFormat { eGetExpressionPathFormatDereferencePointers = 1, @@ -457,6 +457,9 @@ ConstString GetName() const; + /// Returns a unique id for this ValueObject. + lldb::user_id_t GetID() const { return m_id.GetID(); } + virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx, bool can_create); // this will always create the children if necessary @@ -885,6 +888,9 @@ uint64_t m_language_flags = 0; + /// Unique identifier for every value object. + UserID m_id; + // Utility class for initializing all bitfields in ValueObject's constructors. // FIXME: This could be done via default initializers once we have C++20. struct Bitflags { diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -76,9 +76,8 @@ // ValueObject constructor ValueObject::ValueObject(ValueObject &parent) - : UserID(++g_value_obj_uid), // Unique identifier for every value object - m_parent(&parent), m_update_point(parent.GetUpdatePoint()), - m_manager(parent.GetManager()) { + : m_parent(&parent), m_update_point(parent.GetUpdatePoint()), + m_manager(parent.GetManager()), m_id(++g_value_obj_uid) { m_flags.m_is_synthetic_children_generated = parent.m_flags.m_is_synthetic_children_generated; m_data.SetByteOrder(parent.GetDataExtractor().GetByteOrder()); @@ -90,9 +89,9 @@ ValueObject::ValueObject(ExecutionContextScope *exe_scope, ValueObjectManager &manager, AddressType child_ptr_or_ref_addr_type) - : UserID(++g_value_obj_uid), // Unique identifier for every value object - m_update_point(exe_scope), m_manager(&manager), - m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type) { + : m_update_point(exe_scope), m_manager(&manager), + m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type), + m_id(++g_value_obj_uid) { if (exe_scope) { TargetSP target_sp(exe_scope->CalculateTarget()); if (target_sp) { diff --git a/lldb/source/DataFormatters/TypeSynthetic.cpp b/lldb/source/DataFormatters/TypeSynthetic.cpp --- a/lldb/source/DataFormatters/TypeSynthetic.cpp +++ b/lldb/source/DataFormatters/TypeSynthetic.cpp @@ -128,7 +128,7 @@ ValueObject &backend) : SyntheticChildrenFrontEnd(backend), m_python_class(pclass), m_wrapper_sp(), m_interpreter(nullptr) { - if (backend == LLDB_INVALID_UID) + if (backend.GetID() == LLDB_INVALID_UID) return; TargetSP target_sp = backend.GetTargetSP();