summaryrefslogtreecommitdiffstats
path: root/src/core/debugger/gdbstub.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-07-15 04:32:24 +0200
committerLiam <byteslice@airmail.cc>2023-07-22 17:19:29 +0200
commit9f3f615e054663fd6e538fa2db86271b467a6bfd (patch)
tree1c826b4de5fc2b51cbade16a6fedb969df8b437d /src/core/debugger/gdbstub.cpp
parentmemory: minimize dependency on process (diff)
downloadyuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar.gz
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar.bz2
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar.lz
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar.xz
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.tar.zst
yuzu-9f3f615e054663fd6e538fa2db86271b467a6bfd.zip
Diffstat (limited to '')
-rw-r--r--src/core/debugger/gdbstub.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
index da6078372..0f839d5b4 100644
--- a/src/core/debugger/gdbstub.cpp
+++ b/src/core/debugger/gdbstub.cpp
@@ -261,10 +261,8 @@ void GDBStub::ExecuteCommand(std::string_view packet, std::vector<DebuggerAction
const size_t addr{static_cast<size_t>(strtoll(command.data(), nullptr, 16))};
const size_t size{static_cast<size_t>(strtoll(command.data() + sep, nullptr, 16))};
- if (system.ApplicationMemory().IsValidVirtualAddressRange(addr, size)) {
- std::vector<u8> mem(size);
- system.ApplicationMemory().ReadBlock(addr, mem.data(), size);
-
+ std::vector<u8> mem(size);
+ if (system.ApplicationMemory().ReadBlock(addr, mem.data(), size)) {
SendReply(Common::HexToString(mem));
} else {
SendReply(GDB_STUB_REPLY_ERR);
@@ -281,8 +279,7 @@ void GDBStub::ExecuteCommand(std::string_view packet, std::vector<DebuggerAction
const auto mem_substr{std::string_view(command).substr(mem_sep)};
const auto mem{Common::HexStringToVector(mem_substr, false)};
- if (system.ApplicationMemory().IsValidVirtualAddressRange(addr, size)) {
- system.ApplicationMemory().WriteBlock(addr, mem.data(), size);
+ if (system.ApplicationMemory().WriteBlock(addr, mem.data(), size)) {
system.InvalidateCpuInstructionCacheRange(addr, size);
SendReply(GDB_STUB_REPLY_OK);
} else {