Author: Pavel Labath Date: 2020-02-07T09:20:22-08:00 New Revision: 80331610729137db55d29c902e5e464fbf9bd931
URL: https://github.com/llvm/llvm-project/commit/80331610729137db55d29c902e5e464fbf9bd931 DIFF: https://github.com/llvm/llvm-project/commit/80331610729137db55d29c902e5e464fbf9bd931.diff LOG: [lldb] Delete ValueObjectRegisterContext class It is unused. Added: Modified: lldb/include/lldb/Core/ValueObjectRegister.h lldb/source/Core/ValueObjectRegister.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h index 8f364380adb6..28dad993d05a 100644 --- a/lldb/include/lldb/Core/ValueObjectRegister.h +++ b/lldb/include/lldb/Core/ValueObjectRegister.h @@ -28,43 +28,6 @@ class ExecutionContextScope; class Scalar; class Stream; -// A ValueObject that contains a root variable that may or may not -// have children. -class ValueObjectRegisterContext : public ValueObject { -public: - ~ValueObjectRegisterContext() override; - - uint64_t GetByteSize() override; - - lldb::ValueType GetValueType() const override { - return lldb::eValueTypeRegisterSet; - } - - ConstString GetTypeName() override; - - ConstString GetQualifiedTypeName() override; - - ConstString GetDisplayTypeName() override; - - size_t CalculateNumChildren(uint32_t max) override; - - ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member, - int32_t synthetic_index) override; - -protected: - bool UpdateValue() override; - - CompilerType GetCompilerTypeImpl() override; - - lldb::RegisterContextSP m_reg_ctx_sp; - -private: - ValueObjectRegisterContext(ValueObject &parent, - lldb::RegisterContextSP ®_ctx_sp); - // For ValueObject only - DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterContext); -}; - class ValueObjectRegisterSet : public ValueObject { public: ~ValueObjectRegisterSet() override; diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index 22a7b1513d3a..f05f77266fae 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -35,72 +35,6 @@ class ExecutionContextScope; using namespace lldb; using namespace lldb_private; -#pragma mark ValueObjectRegisterContext - -ValueObjectRegisterContext::ValueObjectRegisterContext( - ValueObject &parent, RegisterContextSP ®_ctx) - : ValueObject(parent), m_reg_ctx_sp(reg_ctx) { - assert(reg_ctx); - m_name.SetCString("Registers"); - SetValueIsValid(true); -} - -ValueObjectRegisterContext::~ValueObjectRegisterContext() {} - -CompilerType ValueObjectRegisterContext::GetCompilerTypeImpl() { - return CompilerType(); -} - -ConstString ValueObjectRegisterContext::GetTypeName() { return ConstString(); } - -ConstString ValueObjectRegisterContext::GetDisplayTypeName() { - return ConstString(); -} - -ConstString ValueObjectRegisterContext::GetQualifiedTypeName() { - return ConstString(); -} - -size_t ValueObjectRegisterContext::CalculateNumChildren(uint32_t max) { - auto reg_set_count = m_reg_ctx_sp->GetRegisterSetCount(); - return reg_set_count <= max ? reg_set_count : max; -} - -uint64_t ValueObjectRegisterContext::GetByteSize() { return 0; } - -bool ValueObjectRegisterContext::UpdateValue() { - m_error.Clear(); - ExecutionContext exe_ctx(GetExecutionContextRef()); - StackFrame *frame = exe_ctx.GetFramePtr(); - if (frame) - m_reg_ctx_sp = frame->GetRegisterContext(); - else - m_reg_ctx_sp.reset(); - - if (m_reg_ctx_sp.get() == nullptr) { - SetValueIsValid(false); - m_error.SetErrorToGenericError(); - } else - SetValueIsValid(true); - - return m_error.Success(); -} - -ValueObject *ValueObjectRegisterContext::CreateChildAtIndex( - size_t idx, bool synthetic_array_member, int32_t synthetic_index) { - ValueObject *new_valobj = nullptr; - - const size_t num_children = GetNumChildren(); - if (idx < num_children) { - ExecutionContext exe_ctx(GetExecutionContextRef()); - new_valobj = new ValueObjectRegisterSet( - exe_ctx.GetBestExecutionContextScope(), m_reg_ctx_sp, idx); - } - - return new_valobj; -} - -#pragma mark - #pragma mark ValueObjectRegisterSet ValueObjectSP _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits