Make %p consistent with glibc and musl

See #61
This commit is contained in:
Justine Tunney 2021-03-06 14:26:36 -08:00
parent 937d921018
commit c3ed8d6c7f
11 changed files with 141 additions and 73 deletions

View file

@ -49,14 +49,14 @@ static void FormatStartPage(struct Pml4tFormater *pp, int64_t start) {
pp->t = true;
pp->start = start;
if (pp->lines++) AppendChar(&pp->b, '\n');
AppendFmt(&pp->b, "%p-", start);
AppendFmt(&pp->b, "%012lx-", start);
}
static void FormatEndPage(struct Pml4tFormater *pp, int64_t end) {
int64_t size;
pp->t = false;
size = end - pp->start;
AppendFmt(&pp->b, "%p %p %,ld bytes", end - 1, size, size);
AppendFmt(&pp->b, "%012lx %012lx %,ld bytes", end - 1, size, size);
}
static void *GetPt(struct Machine *m, uint64_t r) {