Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/ddb/db_command.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/ddb/db_command.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.60.2.1 retrieving revision 1.60.2.2 diff -u -p -r1.60.2.1 -r1.60.2.2 --- src/sys/ddb/db_command.c 2001/08/03 04:12:50 1.60.2.1 +++ src/sys/ddb/db_command.c 2001/08/25 06:16:07 1.60.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: db_command.c,v 1.60.2.1 2001/08/03 04:12:50 lukem Exp $ */ +/* $NetBSD: db_command.c,v 1.60.2.2 2001/08/25 06:16:07 thorpej Exp $ */ /* * Mach Operating System @@ -39,6 +39,7 @@ #include #include #include +#include #include /* type definitions */ @@ -361,6 +362,24 @@ db_map_print_cmd(addr, have_addr, count, /*ARGSUSED*/ void +db_malloc_print_cmd(addr, have_addr, count, modif) + db_expr_t addr; + int have_addr; + db_expr_t count; + char * modif; +{ +#ifdef MALLOC_DEBUG + if (!have_addr) + addr = 0; + + debug_malloc_printit(db_printf, (vaddr_t) addr); +#else + db_printf("The kernel is not built with the MALLOC_DEBUG option.\n"); +#endif /* MALLOC_DEBUG */ +} + +/*ARGSUSED*/ +void db_object_print_cmd(addr, have_addr, count, modif) db_expr_t addr; int have_addr; @@ -482,6 +501,7 @@ static const struct db_command db_show_c { "uvmexp", db_uvmexp_print_cmd, 0, NULL }, { "vnode", db_vnode_print_cmd, 0, NULL }, { "watches", db_listwatch_cmd, 0, NULL }, + { "malloc", db_malloc_print_cmd, 0, NULL }, { NULL, NULL, 0, NULL } };