omjavaid created this revision. omjavaid added a reviewer: labath. Herald added a subscriber: kristof.beyls. Herald added a reviewer: rengolin. omjavaid added a child revision: D82866: [LLDB] Test SVE dynamic resize with multiple threads.
This patch adds GetByteOffset to SBValue interface for accessing register offset from register infos. This was needed to write tests to verify that AArch64 register sizes and offsets are updated when a thread updates vector granule register vg. A follow up test will make use of this API to test LLDB SVE register in multithreaded mode with dynamic update of size and offset. https://reviews.llvm.org/D82865 Files: lldb/bindings/interface/SBValue.i lldb/include/lldb/API/SBValue.h lldb/include/lldb/Core/ValueObjectRegister.h lldb/include/lldb/Core/ValueObjectSyntheticFilter.h lldb/source/API/SBValue.cpp lldb/source/Core/ValueObjectRegister.cpp lldb/source/Core/ValueObjectSyntheticFilter.cpp
Index: lldb/source/Core/ValueObjectSyntheticFilter.cpp =================================================================== --- lldb/source/Core/ValueObjectSyntheticFilter.cpp +++ lldb/source/Core/ValueObjectSyntheticFilter.cpp @@ -123,6 +123,10 @@ uint64_t ValueObjectSynthetic::GetByteSize() { return m_parent->GetByteSize(); } +uint64_t ValueObjectSynthetic::GetByteOffset() { + return m_parent->GetByteOffset(); +} + lldb::ValueType ValueObjectSynthetic::GetValueType() const { return m_parent->GetValueType(); } Index: lldb/source/Core/ValueObjectRegister.cpp =================================================================== --- lldb/source/Core/ValueObjectRegister.cpp +++ lldb/source/Core/ValueObjectRegister.cpp @@ -231,6 +231,8 @@ uint64_t ValueObjectRegister::GetByteSize() { return m_reg_info.byte_size; } +uint64_t ValueObjectRegister::GetByteOffset() { return m_reg_info.byte_offset; } + bool ValueObjectRegister::UpdateValue() { m_error.Clear(); ExecutionContext exe_ctx(GetExecutionContextRef()); Index: lldb/source/API/SBValue.cpp =================================================================== --- lldb/source/API/SBValue.cpp +++ lldb/source/API/SBValue.cpp @@ -339,6 +339,20 @@ return result; } +size_t SBValue::GetByteOffset() { + LLDB_RECORD_METHOD_NO_ARGS(size_t, SBValue, GetByteOffset); + + size_t result = 0; + + ValueLocker locker; + lldb::ValueObjectSP value_sp(GetSP(locker)); + if (value_sp) { + result = value_sp->GetByteOffset(); + } + + return result; +} + bool SBValue::IsInScope() { LLDB_RECORD_METHOD_NO_ARGS(bool, SBValue, IsInScope); Index: lldb/include/lldb/Core/ValueObjectSyntheticFilter.h =================================================================== --- lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -38,6 +38,8 @@ uint64_t GetByteSize() override; + uint64_t GetByteOffset() override; + ConstString GetTypeName() override; ConstString GetQualifiedTypeName() override; Index: lldb/include/lldb/Core/ValueObjectRegister.h =================================================================== --- lldb/include/lldb/Core/ValueObjectRegister.h +++ lldb/include/lldb/Core/ValueObjectRegister.h @@ -88,6 +88,8 @@ uint64_t GetByteSize() override; + uint64_t GetByteOffset() override; + lldb::ValueType GetValueType() const override { return lldb::eValueTypeRegister; } Index: lldb/include/lldb/API/SBValue.h =================================================================== --- lldb/include/lldb/API/SBValue.h +++ lldb/include/lldb/API/SBValue.h @@ -46,6 +46,8 @@ size_t GetByteSize(); + size_t GetByteOffset(); + bool IsInScope(); lldb::Format GetFormat(); Index: lldb/bindings/interface/SBValue.i =================================================================== --- lldb/bindings/interface/SBValue.i +++ lldb/bindings/interface/SBValue.i @@ -89,6 +89,9 @@ size_t GetByteSize (); + size_t + GetByteOffset (); + bool IsInScope ();
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits