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

Side by Side Diff: tools/grokdump.py

Issue 10467003: Fix grokdump inspector search for invalid addresses. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 """ 1455 """
1456 Interpret memory at the given address (if available) as a sequence 1456 Interpret memory at the given address (if available) as a sequence
1457 of words. Automatic alignment is not performed. 1457 of words. Automatic alignment is not performed.
1458 """ 1458 """
1459 start = int(address, 16) 1459 start = int(address, 16)
1460 if (start & self.heap.ObjectAlignmentMask()) != 0: 1460 if (start & self.heap.ObjectAlignmentMask()) != 0:
1461 print "Warning: Dumping un-aligned memory, is this what you had in mind?" 1461 print "Warning: Dumping un-aligned memory, is this what you had in mind?"
1462 for slot in xrange(start, 1462 for slot in xrange(start,
1463 start + self.reader.PointerSize() * 10, 1463 start + self.reader.PointerSize() * 10,
1464 self.reader.PointerSize()): 1464 self.reader.PointerSize()):
1465 if not self.reader.IsValidAddress(slot):
1466 print "Address is not contained within the minidump!"
1467 return
1465 maybe_address = self.reader.ReadUIntPtr(slot) 1468 maybe_address = self.reader.ReadUIntPtr(slot)
1466 heap_object = self.padawan.SenseObject(maybe_address) 1469 heap_object = self.padawan.SenseObject(maybe_address)
1467 print "%s: %s %s" % (self.reader.FormatIntPtr(slot), 1470 print "%s: %s %s" % (self.reader.FormatIntPtr(slot),
1468 self.reader.FormatIntPtr(maybe_address), 1471 self.reader.FormatIntPtr(maybe_address),
1469 heap_object or '') 1472 heap_object or '')
1470 1473
1471 def do_do(self, address): 1474 def do_do(self, address):
1472 """ 1475 """
1473 Interpret memory at the given address as a V8 object. Automatic 1476 Interpret memory at the given address as a V8 object. Automatic
1474 alignment makes sure that you can pass tagged as well as un-tagged 1477 alignment makes sure that you can pass tagged as well as un-tagged
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 parser = optparse.OptionParser(USAGE) 1652 parser = optparse.OptionParser(USAGE)
1650 parser.add_option("-s", "--shell", dest="shell", action="store_true", 1653 parser.add_option("-s", "--shell", dest="shell", action="store_true",
1651 help="start an interactive inspector shell") 1654 help="start an interactive inspector shell")
1652 parser.add_option("-f", "--full", dest="full", action="store_true", 1655 parser.add_option("-f", "--full", dest="full", action="store_true",
1653 help="dump all information contained in the minidump") 1656 help="dump all information contained in the minidump")
1654 options, args = parser.parse_args() 1657 options, args = parser.parse_args()
1655 if len(args) != 1: 1658 if len(args) != 1:
1656 parser.print_help() 1659 parser.print_help()
1657 sys.exit(1) 1660 sys.exit(1)
1658 AnalyzeMinidump(options, args[0]) 1661 AnalyzeMinidump(options, args[0])
OLDNEW
« 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