Tidy up
This commit is contained in:
@@ -173,7 +173,7 @@ struct Breakpoint {
|
||||
bool active;
|
||||
VAddr addr;
|
||||
u64 len;
|
||||
u8 inst[4];
|
||||
std::array<u8, 4> inst;
|
||||
};
|
||||
|
||||
using BreakpointMap = std::map<VAddr, Breakpoint>;
|
||||
@@ -454,7 +454,7 @@ static void RemoveBreakpoint(BreakpointType type, VAddr addr) {
|
||||
|
||||
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:016X} bytes at {:016X} of type {}",
|
||||
bp->second.len, bp->second.addr, static_cast<int>(type));
|
||||
Memory::WriteBlock(bp->second.addr, bp->second.inst, 4);
|
||||
Memory::WriteBlock(bp->second.addr, bp->second.inst.data(), bp->second.inst.size());
|
||||
Core::System::GetInstance().InvalidateCpuInstructionCaches();
|
||||
p.erase(addr);
|
||||
}
|
||||
@@ -994,9 +994,9 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) {
|
||||
breakpoint.active = true;
|
||||
breakpoint.addr = addr;
|
||||
breakpoint.len = len;
|
||||
Memory::ReadBlock(addr, breakpoint.inst, 4);
|
||||
static const u8 btrap[] = {0xd4, 0x20, 0x7d, 0x00};
|
||||
Memory::WriteBlock(addr, btrap, 4);
|
||||
Memory::ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size());
|
||||
static constexpr std::array<u8, 4> btrap{{0xd4, 0x20, 0x7d, 0x0}};
|
||||
Memory::WriteBlock(addr, btrap.data(), btrap.size());
|
||||
Core::System::GetInstance().InvalidateCpuInstructionCaches();
|
||||
p.insert({addr, breakpoint});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user