diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h @@ -71,6 +71,11 @@ uint32_t NumSupportedHardwareWatchpoints(); private: + RegisterInfoPOSIX_arm64::GPR m_gpr_arm64; // 64-bit general purpose registers. + + RegisterInfoPOSIX_arm64::FPU + m_fpr; // floating-point registers including extended register sets. + ProcessMonitor &GetMonitor(); }; diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp @@ -24,7 +24,10 @@ RegisterContextPOSIXProcessMonitor_arm64( lldb_private::Thread &thread, std::unique_ptr register_info) - : RegisterContextPOSIX_arm64(thread, std::move(register_info)) {} + : RegisterContextPOSIX_arm64(thread, std::move(register_info)) { + ::memset(&m_fpr, 0, sizeof m_gpr_arm64); + ::memset(&m_fpr, 0, sizeof m_fpr); +} ProcessMonitor &RegisterContextPOSIXProcessMonitor_arm64::GetMonitor() { lldb::ProcessSP base = CalculateProcess(); @@ -226,11 +229,11 @@ unsigned RegisterContextPOSIXProcessMonitor_arm64::GetRegisterIndexFromOffset( unsigned offset) { unsigned reg; - for (reg = 0; reg < k_num_registers_arm64; reg++) { + for (reg = 0; reg < GetRegisterCount(); reg++) { if (GetRegisterInfo()[reg].byte_offset == offset) break; } - assert(reg < k_num_registers_arm64 && "Invalid register offset."); + assert(reg < GetRegisterCount() && "Invalid register offset."); return reg; } diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h @@ -11,7 +11,6 @@ #include "RegisterInfoInterface.h" #include "RegisterInfoPOSIX_arm64.h" -#include "lldb-arm64-register-enums.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Utility/Log.h" @@ -46,13 +45,6 @@ const char *GetRegisterName(unsigned reg); protected: - uint64_t m_gpr_arm64[lldb_private::k_num_gpr_registers_arm64]; // 64-bit - // general - // purpose - // registers. - - struct RegisterInfoPOSIX_arm64::FPU - m_fpr; // floating-point registers including extended register sets. std::unique_ptr m_register_info_up; virtual const lldb_private::RegisterInfo *GetRegisterInfo(); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp @@ -43,10 +43,7 @@ lldb_private::Thread &thread, std::unique_ptr register_info) : lldb_private::RegisterContext(thread, 0), - m_register_info_up(std::move(register_info)) { - - ::memset(&m_fpr, 0, sizeof m_fpr); -} + m_register_info_up(std::move(register_info)) {} RegisterContextPOSIX_arm64::~RegisterContextPOSIX_arm64() {}