summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-07-10 16:28:11 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-28 15:48:05 +0200
commit78487aa5a834d0a5e8e0c6c5490e3bce26e8756d (patch)
treedc33ba35b94682632b93357a586a99786e596383
parentfc8060c06b859f383d48fd45c58d53d16602efbe (diff)
yyy vm: add vm_map_info
-rw-r--r--vm/vm_map.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c
index 1b331d6..99481c7 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -4858,4 +4858,58 @@ void vm_map_copy_print(copy)
indent -= 2;
}
+
+/*
+ * vm_map_info: [ debug ]
+ *
+ * Like vm_map_print, but less verbose. Output is similar to
+ * that of /bin/vminfo.
+ */
+void vm_map_info(vm_map_t map)
+{
+ vm_map_entry_t entry;
+
+ printf("Task map 0x%X: pmap=0x%X,",
+ (vm_offset_t) map, (vm_offset_t) (map->pmap));
+ printf("ref=%d,nentries=%d,", map->ref_count, map->hdr.nentries);
+ printf("version=%d\n", map->timestamp);
+
+ for (entry = vm_map_first_entry(map);
+ entry != vm_map_to_entry(map);
+ entry = entry->vme_next) {
+ static char *inheritance_name[3] = { "share", "copy", "none"};
+
+ /* Offset and size. */
+ printf("0x%X[0x%X] ",
+ (vm_offset_t) entry->vme_start,
+ (vm_offset_t) entry->vme_end
+ - (vm_offset_t) entry->vme_start);
+
+ static char *protections[] = {
+ "0", "R", "W", "RW", "X", "RX", "WX", "RWX",
+ };
+ printf("(prot=%s, max_prot=%s",
+ protections[entry->protection],
+ protections[entry->max_protection]);
+ if (entry->is_sub_map)
+ printf(", submap=0x%X",
+ (vm_offset_t) entry->object.sub_map);
+ else if (entry->object.vm_object)
+ printf(", object=0x%X",
+ (vm_offset_t) entry->object.vm_object);
+ if (entry->offset)
+ printf(", offs=0x%x", entry->offset);
+ if (entry->inheritance != VM_INHERIT_NONE)
+ printf(", %s", inheritance_name[entry->inheritance]);
+ if (entry->wired_count != 0) {
+ printf(", wired=");
+ if (entry->user_wired_count != 0)
+ printf("u");
+ if (entry->wired_count >
+ ((entry->user_wired_count == 0) ? 0 : 1))
+ printf("k");
+ }
+ printf(")\n");
+ }
+}
#endif /* MACH_KDB */