Memory: move block operations into class
This commit is contained in:
parent
323990d402
commit
2582d64fb3
13 changed files with 174 additions and 159 deletions
|
@ -409,8 +409,9 @@ static void RemoveBreakpoint(BreakpointType type, VAddr addr) {
|
|||
|
||||
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:08x} bytes at {:08x} of type {}",
|
||||
bp->second.len, bp->second.addr, static_cast<int>(type));
|
||||
Memory::WriteBlock(*Core::System::GetInstance().Kernel().GetCurrentProcess(), bp->second.addr,
|
||||
bp->second.inst.data(), bp->second.inst.size());
|
||||
Core::System::GetInstance().Memory().WriteBlock(
|
||||
*Core::System::GetInstance().Kernel().GetCurrentProcess(), bp->second.addr,
|
||||
bp->second.inst.data(), bp->second.inst.size());
|
||||
Core::CPU().ClearInstructionCache();
|
||||
p.erase(addr);
|
||||
}
|
||||
|
@ -837,8 +838,8 @@ static void ReadMemory() {
|
|||
}
|
||||
|
||||
std::vector<u8> data(len);
|
||||
Memory::ReadBlock(*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, data.data(),
|
||||
len);
|
||||
Core::System::GetInstance().Memory().ReadBlock(
|
||||
*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, data.data(), len);
|
||||
|
||||
MemToGdbHex(reply, data.data(), len);
|
||||
reply[len * 2] = '\0';
|
||||
|
@ -863,8 +864,8 @@ static void WriteMemory() {
|
|||
std::vector<u8> data(len);
|
||||
|
||||
GdbHexToMem(data.data(), len_pos + 1, len);
|
||||
Memory::WriteBlock(*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, data.data(),
|
||||
len);
|
||||
Core::System::GetInstance().Memory().WriteBlock(
|
||||
*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, data.data(), len);
|
||||
Core::CPU().ClearInstructionCache();
|
||||
SendReply("OK");
|
||||
}
|
||||
|
@ -917,11 +918,13 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u32 len) {
|
|||
breakpoint.active = true;
|
||||
breakpoint.addr = addr;
|
||||
breakpoint.len = len;
|
||||
Memory::ReadBlock(*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr,
|
||||
breakpoint.inst.data(), breakpoint.inst.size());
|
||||
Core::System::GetInstance().Memory().ReadBlock(
|
||||
*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, breakpoint.inst.data(),
|
||||
breakpoint.inst.size());
|
||||
static constexpr std::array<u8, 4> btrap{0x70, 0x00, 0x20, 0xe1};
|
||||
Memory::WriteBlock(*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr,
|
||||
btrap.data(), btrap.size());
|
||||
Core::System::GetInstance().Memory().WriteBlock(
|
||||
*Core::System::GetInstance().Kernel().GetCurrentProcess(), addr, btrap.data(),
|
||||
btrap.size());
|
||||
Core::CPU().ClearInstructionCache();
|
||||
p.insert({addr, breakpoint});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue