diff options
author | cperciva <cperciva@FreeBSD.org> | 2009-11-14 09:33:51 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2009-11-14 09:33:51 +0000 |
commit | 54458befa17d26d05a8f24e936bc5e032ba901fe (patch) | |
tree | 2fb91b041d87799cf113a0f688eb2cb7f8547506 /usr.bin | |
parent | 4b1529ed294784d4fdd353a1db7c14d55cc4a985 (diff) | |
download | FreeBSD-src-54458befa17d26d05a8f24e936bc5e032ba901fe.zip FreeBSD-src-54458befa17d26d05a8f24e936bc5e032ba901fe.tar.gz |
Update malloc utrace structure parsing to reflect the change (r199265)
in how malloc_init is logged from (0, 0, 0) to (-1, 0, 0).
While we're here, simplify the logic.
Reviewed by: jhb (earlier version)
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/kdump/kdump.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 60ce05f..305e584 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1121,17 +1121,14 @@ ktruser_malloc(int len, unsigned char *p) { struct utrace_malloc *ut = (struct utrace_malloc *)p; - if (ut->p == NULL) { - if (ut->s == 0 && ut->r == NULL) - printf("malloc_init()\n"); - else - printf("%p = malloc(%zu)\n", ut->r, ut->s); - } else { - if (ut->s == 0) - printf("free(%p)\n", ut->p); - else - printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s); - } + if (ut->p == (void *)(intptr_t)(-1)) + printf("malloc_init()\n"); + else if (ut->s == 0) + printf("free(%p)\n", ut->p); + else if (ut->p == NULL) + printf("%p = malloc(%zu)\n", ut->r, ut->s); + else + printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s); } void |