summaryrefslogtreecommitdiff
path: root/src/core/gdbstub/gdbstub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/gdbstub/gdbstub.cpp')
-rw-r--r--src/core/gdbstub/gdbstub.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index 78e44f3bd..1c74a44d8 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -969,13 +969,13 @@ static void ReadMemory() {
969 SendReply("E01"); 969 SendReply("E01");
970 } 970 }
971 971
972 const auto& memory = Core::System::GetInstance().Memory(); 972 auto& memory = Core::System::GetInstance().Memory();
973 if (!memory.IsValidVirtualAddress(addr)) { 973 if (!memory.IsValidVirtualAddress(addr)) {
974 return SendReply("E00"); 974 return SendReply("E00");
975 } 975 }
976 976
977 std::vector<u8> data(len); 977 std::vector<u8> data(len);
978 Memory::ReadBlock(addr, data.data(), len); 978 memory.ReadBlock(addr, data.data(), len);
979 979
980 MemToGdbHex(reply, data.data(), len); 980 MemToGdbHex(reply, data.data(), len);
981 reply[len * 2] = '\0'; 981 reply[len * 2] = '\0';
@@ -1057,7 +1057,9 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) {
1057 breakpoint.active = true; 1057 breakpoint.active = true;
1058 breakpoint.addr = addr; 1058 breakpoint.addr = addr;
1059 breakpoint.len = len; 1059 breakpoint.len = len;
1060 Memory::ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size()); 1060
1061 auto& memory = Core::System::GetInstance().Memory();
1062 memory.ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size());
1061 1063
1062 static constexpr std::array<u8, 4> btrap{0x00, 0x7d, 0x20, 0xd4}; 1064 static constexpr std::array<u8, 4> btrap{0x00, 0x7d, 0x20, 0xd4};
1063 if (type == BreakpointType::Execute) { 1065 if (type == BreakpointType::Execute) {