mirror of
https://github.com/reswitched/Mephisto.git
synced 2024-06-16 03:16:50 -04:00
use different printf format on macos
This commit is contained in:
parent
3b2063f6c7
commit
b1007d44f5
2
Cpu.cpp
2
Cpu.cpp
|
@ -37,7 +37,7 @@ void mmioHook(uc_engine *uc, uc_mem_type type, gptr address, uint32_t size, gptr
|
|||
|
||||
break;
|
||||
case UC_MEM_WRITE:
|
||||
LOG_DEBUG(Cpu, "MMIO Write at " ADDRFMT " size %x data %lx", physicalAddress, size, value);
|
||||
LOG_DEBUG(Cpu, "MMIO Write at " ADDRFMT " size %x data " LONGFMT, physicalAddress, size, value);
|
||||
mmio->write(physicalAddress, size, value);
|
||||
break;
|
||||
}
|
||||
|
|
9
Ctu.h
9
Ctu.h
|
@ -47,8 +47,13 @@ const gptr TERMADDR = 1ULL << 61;
|
|||
|
||||
#define FOURCC(a, b, c, d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
|
||||
|
||||
#define ADDRFMT "%016lx"
|
||||
#define LONGFMT "%lx"
|
||||
#ifdef __APPLE__
|
||||
#define ADDRFMT "%016llx"
|
||||
#define LONGFMT "%llx"
|
||||
#else
|
||||
#define ADDRFMT "%016lx"
|
||||
#define LONGFMT "%lx"
|
||||
#endif
|
||||
|
||||
enum LogLevel {
|
||||
None = 0,
|
||||
|
|
|
@ -243,7 +243,7 @@ void GdbStub::removeBreakpoint(BreakpointType type, gptr addr) {
|
|||
|
||||
auto bp = p.find(addr);
|
||||
if(bp != p.end()) {
|
||||
LOG_DEBUG(GdbStub, "gdb: removed a breakpoint: %016lx bytes at %016lx of type %d",
|
||||
LOG_DEBUG(GdbStub, "gdb: removed a breakpoint: " ADDRFMT " bytes at " ADDRFMT " of type %d",
|
||||
bp->second.len, bp->second.addr, type);
|
||||
ctu->cpu.removeBreakpoint(bp->second.hook);
|
||||
p.erase(addr);
|
||||
|
@ -275,7 +275,7 @@ bool GdbStub::checkBreakpoint(gptr addr, BreakpointType type) {
|
|||
|
||||
if(bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) {
|
||||
LOG_DEBUG(GdbStub,
|
||||
"Found breakpoint type %d @ %016lx, range: %016lx - %016lx (%d bytes)", type,
|
||||
"Found breakpoint type %d @ " ADDRFMT ", range: " ADDRFMT " - " ADDRFMT " (%d bytes)", type,
|
||||
addr, bp->second.addr, bp->second.addr + len, (uint32_t) len);
|
||||
return true;
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ void GdbStub::readMemory() {
|
|||
start_offset = addr_pos + 1;
|
||||
auto len = hexToInt(start_offset, static_cast<uint32_t>((commandBuffer + commandLength) - start_offset));
|
||||
|
||||
LOG_DEBUG(GdbStub, "gdb: addr: %016lx len: %016lx", addr, len);
|
||||
LOG_DEBUG(GdbStub, "gdb: addr: " ADDRFMT " len: " ADDRFMT, addr, len);
|
||||
|
||||
if(len * 2 > sizeof(reply)) {
|
||||
sendReply("E01");
|
||||
|
@ -580,7 +580,7 @@ bool GdbStub::commitBreakpoint(BreakpointType type, gptr addr, uint32_t len) {
|
|||
|
||||
p.insert({addr, breakpoint});
|
||||
|
||||
LOG_DEBUG(GdbStub, "gdb: added %d breakpoint: %016lx bytes at %016lx", type, breakpoint.len,
|
||||
LOG_DEBUG(GdbStub, "gdb: added %d breakpoint: " ADDRFMT " bytes at " ADDRFMT, type, breakpoint.len,
|
||||
breakpoint.addr);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue