return true;
}
- fprintf(stderr, "ERROR: invalid load from debug module: %ld bytes at 0x%lx\n",
- len, addr);
+ fprintf(stderr, "ERROR: invalid load from debug module: %ld bytes at 0x%016"
+ PRIx64 "\n", len, addr);
return false;
}
addr = DEBUG_START + addr;
if (addr & (len-1)) {
- fprintf(stderr, "ERROR: unaligned store to debug module: %ld bytes at 0x%lx\n",
- len, addr);
+ fprintf(stderr, "ERROR: unaligned store to debug module: %ld bytes at 0x%016"
+ PRIx64 "\n", len, addr);
return false;
}
return true;
}
- fprintf(stderr, "ERROR: invalid store to debug module: %ld bytes at 0x%lx\n",
- len, addr);
+ fprintf(stderr, "ERROR: invalid store to debug module: %ld bytes at 0x%016"
+ PRIx64 "\n", len, addr);
return false;
}
#include <algorithm>
#include <cassert>
+#include <cinttypes>
#include <cstdio>
#include <vector>
(data[6] << 16) | (data[7] << 24));
break;
default:
- fprintf(stderr, "gdbserver error: write %d bytes to 0x%lx -> 0x%lx; "
- "access_size=%d\n", length, vaddr, paddr, access_size);
+ fprintf(stderr, "gdbserver error: write %d bytes to 0x%016" PRIx64
+ " -> 0x%016" PRIx64 "; access_size=%d\n",
+ length, vaddr, paddr, access_size);
gs.send_packet("E12");
return true;
}
}
if (gs.dr_read32(DEBUG_RAM_SIZE / 4 - 1)) {
- fprintf(stderr, "Exception happened while writing to 0x%lx -> 0x%lx\n",
- vaddr, paddr);
+ fprintf(stderr, "Exception happened while writing to 0x%016" PRIx64
+ " -> 0x%016" PRIx64 "\n", vaddr, paddr);
}
offset += access_size;
}
}
fprintf(stderr,
- "ERROR: gdbserver couldn't find appropriate PTEs to translate 0x%lx\n",
+ "ERROR: gdbserver couldn't find appropriate PTEs to translate 0x%016" PRIx64 "\n",
vaddr);
return true;
}
reg_t pte_addr = base + idx * ptesize;
auto it = pte_cache.find(pte_addr);
if (it == pte_cache.end()) {
- fprintf(stderr, "ERROR: gdbserver tried to translate 0x%lx without first "
- "collecting the relevant PTEs.\n", vaddr);
+ fprintf(stderr, "ERROR: gdbserver tried to translate 0x%016" PRIx64
+ " without first collecting the relevant PTEs.\n", vaddr);
die("gdbserver_t::translate()");
}
}
}
- fprintf(stderr, "ERROR: gdbserver tried to translate 0x%lx but the relevant "
- "PTEs are invalid.\n", vaddr);
+ fprintf(stderr, "ERROR: gdbserver tried to translate 0x%016" PRIx64
+ " but the relevant PTEs are invalid.\n", vaddr);
// TODO: Is it better to throw an exception here?
return -1;
}