diff options
| author | 2022-07-04 21:27:12 -0400 | |
|---|---|---|
| committer | 2022-07-04 21:27:12 -0400 | |
| commit | 908c79881b9adfc494143dba78e6934c9be4209a (patch) | |
| tree | 2fc4bdc700bfae82d6bf8f672565f6a9124f95b4 /src/core/debugger/gdbstub_arch.cpp | |
| parent | Merge pull request #8527 from zhaobot/tx-update-20220701033842 (diff) | |
| parent | gdbstub_arch: Directly access SP register (diff) | |
| download | yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.gz yuzu-908c79881b9adfc494143dba78e6934c9be4209a.tar.xz yuzu-908c79881b9adfc494143dba78e6934c9be4209a.zip | |
Merge pull request #8521 from lat9nq/gdbstub-in-bounds
gdbstub_arch: Directly access SP register
Diffstat (limited to 'src/core/debugger/gdbstub_arch.cpp')
| -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 | |||
| 191 | const auto& gprs{context.cpu_registers}; | 191 | const auto& gprs{context.cpu_registers}; |
| 192 | const auto& fprs{context.vector_registers}; | 192 | const auto& fprs{context.vector_registers}; |
| 193 | 193 | ||
| 194 | if (id <= SP_REGISTER) { | 194 | if (id < SP_REGISTER) { |
| 195 | return ValueToHex(gprs[id]); | 195 | return ValueToHex(gprs[id]); |
| 196 | } else if (id == SP_REGISTER) { | ||
| 197 | return ValueToHex(context.sp); | ||
| 196 | } else if (id == PC_REGISTER) { | 198 | } else if (id == PC_REGISTER) { |
| 197 | return ValueToHex(context.pc); | 199 | return ValueToHex(context.pc); |
| 198 | } else if (id == PSTATE_REGISTER) { | 200 | } else if (id == PSTATE_REGISTER) { |
| @@ -215,8 +217,10 @@ void GDBStubA64::RegWrite(Kernel::KThread* thread, size_t id, std::string_view v | |||
| 215 | 217 | ||
| 216 | auto& context{thread->GetContext64()}; | 218 | auto& context{thread->GetContext64()}; |
| 217 | 219 | ||
| 218 | if (id <= SP_REGISTER) { | 220 | if (id < SP_REGISTER) { |
| 219 | context.cpu_registers[id] = HexToValue<u64>(value); | 221 | context.cpu_registers[id] = HexToValue<u64>(value); |
| 222 | } else if (id == SP_REGISTER) { | ||
| 223 | context.sp = HexToValue<u64>(value); | ||
| 220 | } else if (id == PC_REGISTER) { | 224 | } else if (id == PC_REGISTER) { |
| 221 | context.pc = HexToValue<u64>(value); | 225 | context.pc = HexToValue<u64>(value); |
| 222 | } else if (id == PSTATE_REGISTER) { | 226 | } else if (id == PSTATE_REGISTER) { |