diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-07-05 03:27:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 03:27:12 +0200 |
commit | 908c79881b9adfc494143dba78e6934c9be4209a (patch) | |
tree | 2fc4bdc700bfae82d6bf8f672565f6a9124f95b4 | |
parent | Merge pull request #8527 from zhaobot/tx-update-20220701033842 (diff) | |
parent | gdbstub_arch: Directly access SP register (diff) | |
download | yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.gz yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.bz2 yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.lz yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.xz yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.zst yuzu-908c79881b9adfc494143dba78e6934c9be4209a.zip |
-rw-r--r-- | src/core/debugger/gdbstub_arch.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/debugger/gdbstub_arch.cpp b/src/core/debugger/gdbstub_arch.cpp index 750c353b9..4bef09bd7 100644 --- a/src/core/debugger/gdbstub_arch.cpp +++ b/src/core/debugger/gdbstub_arch.cpp @@ -191,8 +191,10 @@ std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const const auto& gprs{context.cpu_registers}; const auto& fprs{context.vector_registers}; - if (id <= SP_REGISTER) { + if (id < SP_REGISTER) { return ValueToHex(gprs[id]); + } else if (id == SP_REGISTER) { + return ValueToHex(context.sp); } else if (id == PC_REGISTER) { return ValueToHex(context.pc); } else if (id == PSTATE_REGISTER) { @@ -215,8 +217,10 @@ void GDBStubA64::RegWrite(Kernel::KThread* thread, size_t id, std::string_view v auto& context{thread->GetContext64()}; - if (id <= SP_REGISTER) { + if (id < SP_REGISTER) { context.cpu_registers[id] = HexToValue<u64>(value); + } else if (id == SP_REGISTER) { + context.sp = HexToValue<u64>(value); } else if (id == PC_REGISTER) { context.pc = HexToValue<u64>(value); } else if (id == PSTATE_REGISTER) { |