Cleanup pretty printers for maps and objects.

This commit is contained in:
brezak 1993-07-22 13:03:36 +00:00
parent cf65527c36
commit 9d7e246a03
3 changed files with 32 additions and 26 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_glue.c 7.8 (Berkeley) 5/15/91
* $Id: vm_glue.c,v 1.10 1993/07/19 13:47:09 cgd Exp $
* vm_glue.c,v 1.8 1993/07/15 15:42:17 cgd Exp
*
*
* Copyright (c) 1987, 1990 Carnegie-Mellon University.
@ -541,6 +541,7 @@ thread_wakeup(event)
splx(s);
}
#if defined(DDB) || #defined(DEBUG)
/*
* DEBUG stuff
*/
@ -555,10 +556,11 @@ iprintf(a, b, c, d, e, f, g, h)
i = indent;
while (i >= 8) {
printf("\t");
db_printf("\t");
i -= 8;
}
for (; i > 0; --i)
printf(" ");
printf(a, b, c, d, e, f, g, h);
db_printf(" ");
db_printf(a, b, c, d, e, f, g, h);
}
#endif /* DDB || DEBUG */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_map.c 7.3 (Berkeley) 4/21/91
* $Id: vm_map.c,v 1.6 1993/07/15 14:25:28 cgd Exp $
* vm_map.c,v 1.6 1993/07/15 14:25:28 cgd Exp
*
*
* Copyright (c) 1987, 1990 Carnegie-Mellon University.
@ -2428,6 +2428,7 @@ vm_map_simplify(map, start)
vm_map_unlock(map);
}
#ifdef DDB
/*
* vm_map_print: [ debug ]
*/
@ -2455,18 +2456,18 @@ vm_map_print(map, full)
if (map->is_main_map) {
static char *inheritance_name[4] =
{ "share", "copy", "none", "donate_copy"};
printf("prot=%x/%x/%s, ",
entry->protection,
entry->max_protection,
inheritance_name[entry->inheritance]);
db_printf("prot=%x/%x/%s, ",
entry->protection,
entry->max_protection,
inheritance_name[entry->inheritance]);
if (entry->wired_count != 0)
printf("wired, ");
db_printf("wired, ");
}
if (entry->is_a_map || entry->is_sub_map) {
printf("share=0x%x, offset=0x%x\n",
(int) entry->object.share_map,
(int) entry->offset);
db_printf("share=0x%x, offset=0x%x\n",
(int) entry->object.share_map,
(int) entry->offset);
if ((entry->prev == &map->header) ||
(!entry->prev->is_a_map) ||
(entry->prev->object.share_map !=
@ -2478,13 +2479,13 @@ vm_map_print(map, full)
}
else {
printf("object=0x%x, offset=0x%x",
(int) entry->object.vm_object,
(int) entry->offset);
db_printf("object=0x%x, offset=0x%x",
(int) entry->object.vm_object,
(int) entry->offset);
if (entry->copy_on_write)
printf(", copy (%s)",
entry->needs_copy ? "needed" : "done");
printf("\n");
db_printf(", copy (%s)",
entry->needs_copy ? "needed" : "done");
db_printf("\n");
if ((entry->prev == &map->header) ||
(entry->prev->is_a_map) ||
@ -2498,3 +2499,4 @@ vm_map_print(map, full)
}
indent -= 2;
}
#endif

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_object.c 7.4 (Berkeley) 5/7/91
* $Id: vm_object.c,v 1.4 1993/06/30 03:48:26 andrew Exp $
* vm_object.c,v 1.4 1993/06/30 03:48:26 andrew Exp
*
*
* Copyright (c) 1987, 1990 Carnegie-Mellon University.
@ -1468,6 +1468,7 @@ boolean_t vm_object_coalesce(prev_object, next_object,
return(TRUE);
}
#if defined(DDB) || defined(DEBUG)
/*
* vm_object_print: [ debug ]
*/
@ -1486,10 +1487,10 @@ void vm_object_print(object, full)
iprintf("Object 0x%x: size=0x%x, res=%d, ref=%d, ",
(int) object, (int) object->size,
object->resident_page_count, object->ref_count);
printf("pager=0x%x+0x%x, shadow=(0x%x)+0x%x\n",
db_printf("pager=0x%x+0x%x, shadow=(0x%x)+0x%x\n",
(int) object->pager, (int) object->paging_offset,
(int) object->shadow, (int) object->shadow_offset);
printf("cache: next=0x%x, prev=0x%x\n",
db_printf("cache: next=0x%x, prev=0x%x\n",
object->cached_list.next, object->cached_list.prev);
if (!full)
@ -1502,17 +1503,18 @@ void vm_object_print(object, full)
if (count == 0)
iprintf("memory:=");
else if (count == 6) {
printf("\n");
db_printf("\n");
iprintf(" ...");
count = 0;
} else
printf(",");
db_printf(",");
count++;
printf("(off=0x%x,page=0x%x)", p->offset, VM_PAGE_TO_PHYS(p));
db_printf("(off=0x%x,page=0x%x)", p->offset, VM_PAGE_TO_PHYS(p));
p = (vm_page_t) queue_next(&p->listq);
}
if (count != 0)
printf("\n");
db_printf("\n");
indent -= 2;
}
#endif