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

Side by Side Diff: tools/grokdump.py

Issue 10910091: Extend grokdump.py with [u]nassemble command (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 1471
1472 1472
1473 class InspectionShell(cmd.Cmd): 1473 class InspectionShell(cmd.Cmd):
1474 def __init__(self, reader, heap): 1474 def __init__(self, reader, heap):
1475 cmd.Cmd.__init__(self) 1475 cmd.Cmd.__init__(self)
1476 self.reader = reader 1476 self.reader = reader
1477 self.heap = heap 1477 self.heap = heap
1478 self.padawan = InspectionPadawan(reader, heap) 1478 self.padawan = InspectionPadawan(reader, heap)
1479 self.prompt = "(grok) " 1479 self.prompt = "(grok) "
1480 1480
1481 def do_u(self, args):
Michael Starzinger 2012/09/05 16:07:39 Can we alpha-sort the do_foo methods?
1482 """
1483 u 0x<address> 0x<size>
1484 Unassemble memory in the region [address, address + size)
1485 """
1486 args = args.split(' ')
1487 start = int(args[0], 16)
1488 size = int(args[1], 16)
1489 lines = self.reader.GetDisasmLines(start, size)
1490 for line in lines:
1491 print FormatDisasmLine(start, self.heap, line)
1492 print
1493
1481 def do_dd(self, address): 1494 def do_dd(self, address):
1482 """ 1495 """
1483 Interpret memory at the given address (if available) as a sequence 1496 Interpret memory at the given address (if available) as a sequence
1484 of words. Automatic alignment is not performed. 1497 of words. Automatic alignment is not performed.
1485 """ 1498 """
1486 start = int(address, 16) 1499 start = int(address, 16)
1487 if (start & self.heap.ObjectAlignmentMask()) != 0: 1500 if (start & self.heap.ObjectAlignmentMask()) != 0:
1488 print "Warning: Dumping un-aligned memory, is this what you had in mind?" 1501 print "Warning: Dumping un-aligned memory, is this what you had in mind?"
1489 for slot in xrange(start, 1502 for slot in xrange(start,
1490 start + self.reader.PointerSize() * 10, 1503 start + self.reader.PointerSize() * 10,
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 parser = optparse.OptionParser(USAGE) 1711 parser = optparse.OptionParser(USAGE)
1699 parser.add_option("-s", "--shell", dest="shell", action="store_true", 1712 parser.add_option("-s", "--shell", dest="shell", action="store_true",
1700 help="start an interactive inspector shell") 1713 help="start an interactive inspector shell")
1701 parser.add_option("-f", "--full", dest="full", action="store_true", 1714 parser.add_option("-f", "--full", dest="full", action="store_true",
1702 help="dump all information contained in the minidump") 1715 help="dump all information contained in the minidump")
1703 options, args = parser.parse_args() 1716 options, args = parser.parse_args()
1704 if len(args) != 1: 1717 if len(args) != 1:
1705 parser.print_help() 1718 parser.print_help()
1706 sys.exit(1) 1719 sys.exit(1)
1707 AnalyzeMinidump(options, args[0]) 1720 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