Commit d5980902 authored by jochen@chromium.org's avatar jochen@chromium.org

When dumping the stack, try to print contents as ASCII

This makes it easier to find strings that are on the stack for debugging

BUG=none
LOG=n
R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 943960df
...@@ -3103,15 +3103,18 @@ def AnalyzeMinidump(options, minidump_name): ...@@ -3103,15 +3103,18 @@ def AnalyzeMinidump(options, minidump_name):
frame_pointer = reader.ExceptionFP() frame_pointer = reader.ExceptionFP()
print "Annotated stack (from exception.esp to bottom):" print "Annotated stack (from exception.esp to bottom):"
for slot in xrange(stack_top, stack_bottom, reader.PointerSize()): for slot in xrange(stack_top, stack_bottom, reader.PointerSize()):
ascii_content = [c if c >= '\x20' and c < '\x7f' else '.'
for c in reader.ReadBytes(slot, reader.PointerSize())]
maybe_address = reader.ReadUIntPtr(slot) maybe_address = reader.ReadUIntPtr(slot)
heap_object = heap.FindObject(maybe_address) heap_object = heap.FindObject(maybe_address)
maybe_symbol = reader.FindSymbol(maybe_address) maybe_symbol = reader.FindSymbol(maybe_address)
if slot == frame_pointer: if slot == frame_pointer:
maybe_symbol = "<---- frame pointer" maybe_symbol = "<---- frame pointer"
frame_pointer = maybe_address frame_pointer = maybe_address
print "%s: %s %s" % (reader.FormatIntPtr(slot), print "%s: %s %s %s" % (reader.FormatIntPtr(slot),
reader.FormatIntPtr(maybe_address), reader.FormatIntPtr(maybe_address),
maybe_symbol or "") "".join(ascii_content),
maybe_symbol or "")
if heap_object: if heap_object:
heap_object.Print(Printer()) heap_object.Print(Printer())
print print
......
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