Index: lldb/source/Plugins/Process/Linux/NativeProcessLinux.h =================================================================== --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -156,6 +156,8 @@ static Status SetDefaultPtraceOpts(const lldb::pid_t); + llvm::Optional GetAuxValue(enum AuxVector::EntryType type); + void MonitorCallback(lldb::pid_t pid, bool exited, WaitStatus status); void WaitForNewThread(::pid_t tid); Index: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -2021,3 +2021,18 @@ return error; } + +llvm::Optional +NativeProcessLinux::GetAuxValue(enum AuxVector::EntryType type) { + if (m_aux_vector == nullptr) { + auto buffer_or_error = GetAuxvData(); + if (!buffer_or_error) + return llvm::None; + DataExtractor auxv_data(buffer_or_error.get()->getBufferStart(), + buffer_or_error.get()->getBufferSize(), + GetByteOrder(), GetAddressByteSize()); + m_aux_vector = std::make_unique(auxv_data); + } + + return m_aux_vector->GetAuxValue(type); +} Index: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -166,6 +166,8 @@ Status ReadHardwareDebugInfo(); + uint32_t QueryAuxvForOptionalRegset(); + Status WriteHardwareDebugRegs(int hwbType); uint32_t CalculateFprOffset(const RegisterInfo *reg_info) const; Index: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -21,6 +21,7 @@ #include "Plugins/Process/Linux/NativeProcessLinux.h" #include "Plugins/Process/Linux/Procfs.h" #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" +#include "Plugins/Process/Utility/AuxVector.h" #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h" // System includes - They have to be included after framework includes because @@ -84,6 +85,10 @@ return static_cast(*m_register_info_interface_up); } +uint32_t NativeRegisterContextLinux_arm64::QueryAuxvForOptionalRegset() { + return ARM64_REGS_CONFIG_DEFAULT; +} + uint32_t NativeRegisterContextLinux_arm64::GetRegisterSetCount() const { return GetRegisterInfo().GetRegisterSetCount(); } @@ -1096,10 +1101,10 @@ // be deemed non operational for the lifetime of current process. if (!m_sve_header_is_valid && m_sve_state != SVEState::Disabled) { Status error = ReadSVEHeader(); - uint32_t opt_regset = ARM64_REGS_CONFIG_DEFAULT; // m_sve_state is set to SVEState::Unknown on first stop and ReadSVEHeader // is called to enable or disable SVE register set. if (m_sve_state == SVEState::Unknown) { + uint32_t opt_regset = QueryAuxvForOptionalRegset(); if (error.Success()) { opt_regset |= ARM64_REGS_CONFIG_SVE; GetRegisterInfo().ConfigureRegisterInfos(opt_regset);