Index: lldb/include/lldb/Host/common/NativeRegisterContext.h =================================================================== --- lldb/include/lldb/Host/common/NativeRegisterContext.h +++ lldb/include/lldb/Host/common/NativeRegisterContext.h @@ -114,6 +114,8 @@ virtual NativeThreadProtocol &GetThread() { return m_thread; } + virtual const RegisterSet *GetExpeditedRegisterSet() const { return nullptr; } + const RegisterInfo *GetRegisterInfoByName(llvm::StringRef reg_name, uint32_t start_idx = 0); Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -806,11 +806,17 @@ // Grab the register context. NativeRegisterContext& reg_ctx = thread->GetRegisterContext(); - // Expedite all registers in the first register set (i.e. should be GPRs) - // that are not contained in other registers. - const RegisterSet *reg_set_p; - if (reg_ctx.GetRegisterSetCount() > 0 && - ((reg_set_p = reg_ctx.GetRegisterSet(0)) != nullptr)) { + const RegisterSet *reg_set_p = reg_ctx.GetExpeditedRegisterSet(); + + if (reg_set_p == nullptr) { + // Architecture does not specify an expedited register set. + // Expedite all registers in the first register set (i.e. should be GPRs) + // that are not contained in other registers. + if (reg_ctx.GetRegisterSetCount() > 0) + reg_set_p = reg_ctx.GetRegisterSet(0); + } + + if (reg_set_p != nullptr) { LLDB_LOGF(log, "GDBRemoteCommunicationServerLLGS::%s expediting registers " "from set '%s' (registers set count: %zu)",