Index: kdump.c =================================================================== RCS file: /usr/cvs/src/usr.bin/kdump/kdump.c,v retrieving revision 1.31 diff -u -r1.31 kdump.c --- kdump.c 12 Jul 2006 13:36:08 -0000 1.31 +++ kdump.c 5 Jan 2007 20:09:36 -0000 @@ -965,9 +965,39 @@ cs->user ? "user" : "kernel"); } +struct utrace_malloc { + void *p; + size_t s; + void *r; +}; + +void +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); + } +} + void ktruser(int len, unsigned char *p) { + + if (len == sizeof(struct utrace_malloc)) { + ktruser_malloc(len, p); + return; + } + (void)printf("%d ", len); while (len--) if (decimal) @@ -975,7 +1005,6 @@ else (void)printf(" %02x", *p++); (void)printf("\n"); - } void