Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/grokdump.py

Issue 10332137: Add -d flag to grokdump to dump all available memory areas (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grokdump.py
===================================================================
--- tools/grokdump.py (revision 11539)
+++ tools/grokdump.py (working copy)
@@ -108,6 +108,24 @@
return Raw
+def do_dump(reader, heap):
+ """Dump all available memory regions."""
+ def dump_region(reader, start, size, location):
+ print "%s - %s" % (reader.FormatIntPtr(start),
+ reader.FormatIntPtr(start + size))
+ for slot in xrange(start,
+ start + size,
+ reader.PointerSize()):
+ maybe_address = reader.ReadUIntPtr(slot)
+ heap_object = heap.FindObject(maybe_address)
+ print "%s: %s" % (reader.FormatIntPtr(slot),
+ reader.FormatIntPtr(maybe_address))
+ if heap_object:
+ heap_object.Print(Printer())
+ print
+
+ reader.ForEachMemoryRegion(dump_region)
+
# Set of structures and constants that describe the layout of minidump
# files. Based on MSDN and Google Breakpad.
@@ -774,7 +792,10 @@
self.right = self.ObjectField(self.RightOffset())
def GetChars(self):
- return self.left.GetChars() + self.right.GetChars()
+ try:
+ return self.left.GetChars() + self.right.GetChars()
+ except:
+ return "***CAUGHT EXCEPTION IN GROKDUMP***"
class Oddball(HeapObject):
@@ -1110,6 +1131,9 @@
print FormatDisasmLine(start, heap, line)
print
+ if options.full:
+ do_dump(reader, heap)
+
if options.shell:
InspectionShell(reader, heap).cmdloop("type help to get help")
else:
@@ -1129,6 +1153,7 @@
if __name__ == "__main__":
parser = optparse.OptionParser(USAGE)
parser.add_option("-s", "--shell", dest="shell", action="store_true")
+ parser.add_option("-f", "--full", dest="full", action="store_true")
options, args = parser.parse_args()
if len(args) != 1:
parser.print_help()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698