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

Unified Diff: tools/grokdump.py

Issue 14660012: Prevent grokdump from crying about invalid input. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
diff --git a/tools/grokdump.py b/tools/grokdump.py
index f3ae8a22ba357ad3c8435fa23fa9ed2fbc0adf9e..1be5cb89e64527a9edb5671df254058a7c031b7e 100755
--- a/tools/grokdump.py
+++ b/tools/grokdump.py
@@ -2036,17 +2036,24 @@ class InspectionShell(cmd.Cmd):
def do_u(self, args):
"""
- u 0x<address> 0x<size>
- Unassemble memory in the region [address, address + size)
+ Unassemble memory in the region [address, address + size). If the
+ size is not specified, a default value of 32 bytes is used.
+ Synopsis: u 0x<address> 0x<size>
"""
args = args.split(' ')
start = int(args[0], 16)
- size = int(args[1], 16)
+ size = int(args[1], 16) if len(args) > 1 else 0x20
+ if not self.reader.IsValidAddress(start):
+ print "Address is not contained within the minidump!"
+ return
lines = self.reader.GetDisasmLines(start, size)
for line in lines:
print FormatDisasmLine(start, self.heap, line)
print
+ def do_EOF(self, none):
+ raise KeyboardInterrupt
+
EIP_PROXIMITY = 64
CONTEXT_FOR_ARCH = {
@@ -2131,7 +2138,10 @@ def AnalyzeMinidump(options, minidump_name):
FullDump(reader, heap)
if options.shell:
- InspectionShell(reader, heap).cmdloop("type help to get help")
+ try:
+ InspectionShell(reader, heap).cmdloop("type help to get help")
+ except KeyboardInterrupt:
+ print "Kthxbye."
else:
if reader.exception is not None:
print "Annotated stack (from exception.esp to bottom):"
« 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