Commit eecfb927 authored by ishell's avatar ishell Committed by Commit bot

Extend grokdump's dd command with a second optional parameter defining number of words to dump.

Review URL: https://codereview.chromium.org/845713002

Cr-Commit-Position: refs/heads/master@{#26007}
parent c72c28dd
......@@ -2807,16 +2807,20 @@ class InspectionShell(cmd.Cmd):
else:
print "%s\n" % string
def do_dd(self, address):
def do_dd(self, args):
"""
Interpret memory at the given address (if available) as a sequence
of words. Automatic alignment is not performed.
Interpret memory in the given region [address, address + num * word_size)
(if available) as a sequence of words. Automatic alignment is not performed.
If the num is not specified, a default value of 16 words is used.
Synopsis: dd 0x<address> 0x<num>
"""
start = int(address, 16)
args = args.split(' ')
start = int(args[0], 16)
num = int(args[1], 16) if len(args) > 1 else 0x10
if (start & self.heap.ObjectAlignmentMask()) != 0:
print "Warning: Dumping un-aligned memory, is this what you had in mind?"
for slot in xrange(start,
start + self.reader.PointerSize() * 10,
start + self.reader.PointerSize() * num,
self.reader.PointerSize()):
if not self.reader.IsValidAddress(slot):
print "Address is not contained within the minidump!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment