X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/cb3231590a3c94ab4375e2228bd5e86b0cf1ad7e..c6bf4f310a33a9262d455ea4d3f0630b1255e3fe:/tools/lldbmacros/memory.py diff --git a/tools/lldbmacros/memory.py b/tools/lldbmacros/memory.py index a73dc5b8a..963db7bcc 100755 --- a/tools/lldbmacros/memory.py +++ b/tools/lldbmacros/memory.py @@ -2772,12 +2772,13 @@ def ShowTaskVMEntries(task, show_pager_info, show_all_shadows): return None showmapvme(task.map, 0, 0, show_pager_info, show_all_shadows, False) -@lldb_command("showmapvme", "A:B:PRST") +@lldb_command("showmapvme", "A:B:F:PRST") def ShowMapVME(cmd_args=None, cmd_options={}): """Routine to print out info about the specified vm_map and its vm entries usage: showmapvme [-A start] [-B end] [-S] [-P] Use -A flag to start at virtual address Use -B flag to end at virtual address + Use -F flag to find just the VME containing the given VA Use -S flag to show VM object shadow chains Use -P flag to show pager info (mapped file, compressed pages, ...) Use -R flag to reverse order @@ -2796,6 +2797,9 @@ def ShowMapVME(cmd_args=None, cmd_options={}): start_vaddr = unsigned(int(cmd_options['-A'], 16)) if "-B" in cmd_options: end_vaddr = unsigned(int(cmd_options['-B'], 16)) + if "-F" in cmd_options: + start_vaddr = unsigned(int(cmd_options['-F'], 16)) + end_vaddr = start_vaddr if "-P" in cmd_options: show_pager_info = True if "-S" in cmd_options: @@ -3117,7 +3121,7 @@ def showvmtags(cmd_args=None, cmd_options={}): if "-A" in cmd_options: all_tags = True page_size = unsigned(kern.globals.page_size) - nsites = unsigned(kern.globals.vm_allocation_tag_highest) + nsites = unsigned(kern.globals.vm_allocation_tag_highest) + 1 tagcounts = [0] * nsites tagpeaks = [0] * nsites tagmapped = [0] * nsites @@ -3139,7 +3143,7 @@ def showvmtags(cmd_args=None, cmd_options={}): total = 0 totalmapped = 0 - print " vm_allocation_tag_highest: {:<7d} ".format(nsites) + print " vm_allocation_tag_highest: {:<7d} ".format(nsites - 1) print " {:<7s} {:>7s} {:>7s} {:>7s} {:<50s}".format("tag.kmod", "peak", "size", "mapped", "name") for tag in range(nsites): if all_tags or tagcounts[tag] or tagmapped[tag]: @@ -4432,7 +4436,7 @@ def showmemoryentry(entry, idx=0, queue_len=0): if entry.is_sub_map == 1: showmapvme(entry.backing.map, 0, 0, show_pager_info, show_all_shadows) if entry.is_copy == 1: - showmapcopyvme(entry.backing.copy, 0, 0, 0, show_pager_info, show_all_shadows, 0) + showmapcopyvme(entry.backing.copy, 0, 0, show_pager_info, show_all_shadows, 0) if entry.is_sub_map == 0 and entry.is_copy == 0: showvmobject(entry.backing.object, entry.offset, entry.size, show_pager_info, show_all_shadows)