diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/debugger/gdbstub.cpp | 1 | ||||
-rw-r--r-- | src/core/debugger/gdbstub_arch.cpp | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp index f5e9a303d..884229c77 100644 --- a/src/core/debugger/gdbstub.cpp +++ b/src/core/debugger/gdbstub.cpp @@ -252,6 +252,7 @@ void GDBStub::ExecuteCommand(std::string_view packet, std::vector<DebuggerAction const auto sep{std::find(command.begin(), command.end(), '=') - command.begin() + 1}; const size_t reg{static_cast<size_t>(strtoll(command.data(), nullptr, 16))}; arch->RegWrite(backend.GetActiveThread(), reg, std::string_view(command).substr(sep)); + SendReply(GDB_STUB_REPLY_OK); break; } case 'm': { 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) { |