Author: Muhammad Omair Javaid Date: 2020-04-29T07:51:30+05:00 New Revision: 9f8b4472fb601fcee84613a558f8d734314d98b5
URL: https://github.com/llvm/llvm-project/commit/9f8b4472fb601fcee84613a558f8d734314d98b5 DIFF: https://github.com/llvm/llvm-project/commit/9f8b4472fb601fcee84613a558f8d734314d98b5.diff LOG: Extend max register size to accommodate AArch64 SVE vector regs Summary: This patch increases maximum register size to 256 bytes to accommodate AArch64 SVE registers maximum possible size of 256 bytes. Reviewers: labath, jankratochvil, rengolin Reviewed By: labath Subscribers: tschuett, kristof.beyls, danielkiss, lldb-commits Differential Revision: https://reviews.llvm.org/D77044 Added: Modified: lldb/include/lldb/Utility/RegisterValue.h lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp lldb/source/Utility/RegisterValue.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Utility/RegisterValue.h b/lldb/include/lldb/Utility/RegisterValue.h index eeb3ce52a82b..494f8be5391c 100644 --- a/lldb/include/lldb/Utility/RegisterValue.h +++ b/lldb/include/lldb/Utility/RegisterValue.h @@ -26,7 +26,8 @@ struct RegisterInfo; class RegisterValue { public: - enum { kMaxRegisterByteSize = 64u }; + // big enough to support up to 256 byte AArch64 SVE + enum { kMaxRegisterByteSize = 256u }; enum Type { eTypeInvalid, @@ -261,7 +262,7 @@ class RegisterValue { struct { uint8_t bytes[kMaxRegisterByteSize]; // This must be big enough to hold any // register for any supported target. - uint8_t length; + uint16_t length; lldb::ByteOrder byte_order; } buffer; }; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 7d6cb2a3484b..ae2f4bd041c9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -2040,7 +2040,7 @@ GDBRemoteCommunicationServerLLGS::Handle_P(StringExtractorGDBRemote &packet) { packet, "P packet missing '=' char after register number"); // Parse out the value. - uint8_t reg_bytes[32]; // big enough to support up to 256 bit ymmN register + uint8_t reg_bytes[RegisterValue::kMaxRegisterByteSize]; size_t reg_size = packet.GetHexBytesAvail(reg_bytes); // Get the thread to use. diff --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp index bb56ade71663..91f4025c923c 100644 --- a/lldb/source/Utility/RegisterValue.cpp +++ b/lldb/source/Utility/RegisterValue.cpp @@ -810,7 +810,7 @@ bool RegisterValue::operator==(const RegisterValue &rhs) const { if (buffer.length != rhs.buffer.length) return false; else { - uint8_t length = buffer.length; + uint16_t length = buffer.length; if (length > kMaxRegisterByteSize) length = kMaxRegisterByteSize; return memcmp(buffer.bytes, rhs.buffer.bytes, length) == 0; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits