aboutsummaryrefslogtreecommitdiff
path: root/src/core/debugger
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-24 13:47:11 -0400
committerGitHub <noreply@github.com>2023-07-24 13:47:11 -0400
commit904e8975ea95005fbf41250a3d9d7df68f4ef096 (patch)
tree731480485f1d42ebc9945ce42351dd5340a4f889 /src/core/debugger
parent297e870ec74de95319f76b404eeb26447c9eb1c8 (diff)
parent46234254b1739c942d227b276d49d98e75356ae0 (diff)
Merge pull request #11095 from liamwhite/memory2
memory: cleanup
Diffstat (limited to 'src/core/debugger')
-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 da6078372e..0f839d5b4c 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 {