memzap

replay memory writes
git clone git://git.2f30.org/memzap
Log | Files | Refs | README | LICENSE

commit c3124088a3f91ad4602f8fb2f6fea710b497e853
parent 6c668ce4b667ea2dd1ffa6095f432a5238d6d4b5
Author: sin <sin@2f30.org>
Date:   Mon,  4 Mar 2013 15:24:26 +0000

mdiffdump: Beautify output

Diffstat:
Mmdiffdump.c | 18+++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/mdiffdump.c b/mdiffdump.c @@ -21,17 +21,21 @@ main(int argc, char *argv[]) if (!hdr) errx(1, "%s: failed to parse mdiff", argv[1]); - printf("endianness: %s\n", + printf("MDIFF header:\n"); + printf(" endianness: %s\n", hdr->endianness ? "big endian" : "little endian"); - printf("version: %hhu\n", hdr->version); - printf("blksize: %lu\n", (unsigned long)hdr->blksize); - printf("nregions: %lu\n", (unsigned long)hdr->nregions); + printf(" version: %hhu\n", hdr->version); + printf(" blksize: %lu\n", (unsigned long)hdr->blksize); + printf(" nregions: %lu\n", (unsigned long)hdr->nregions); + printf("Diff sections:\n"); for (i = 0; i < hdr->nregions; i++) { mdiff = mdiff_read_diff(fd, hdr, i); - printf("offset: %lu\n", (unsigned long)mdiff->offset); - printf("len: %lu\n", (unsigned long)mdiff->len); - printf("buf: "); + printf(" [%lu]: offset: %lu\n", (unsigned long)i, + (unsigned long)mdiff->offset); + printf(" [%lu]: len: %lu\n", (unsigned long)i, + (unsigned long)mdiff->len); + printf(" [%lu]: buf: ", (unsigned long)i); p = mdiff->buf; for (j = 0; j < mdiff->len; j++) putchar(p[j]);