Revision: 23045
Author:   [email protected]
Date:     Mon Aug 11 14:16:43 2014 UTC
Log:      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
[email protected]

Review URL: https://codereview.chromium.org/132503005
http://code.google.com/p/v8/source/detail?r=23045

Modified:
 /branches/bleeding_edge/tools/grokdump.py

=======================================
--- /branches/bleeding_edge/tools/grokdump.py   Wed Mar 26 15:05:01 2014 UTC
+++ /branches/bleeding_edge/tools/grokdump.py   Mon Aug 11 14:16:43 2014 UTC
@@ -3103,15 +3103,18 @@
       frame_pointer = reader.ExceptionFP()
       print "Annotated stack (from exception.esp to bottom):"
       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)
         heap_object = heap.FindObject(maybe_address)
         maybe_symbol = reader.FindSymbol(maybe_address)
         if slot == frame_pointer:
           maybe_symbol = "<---- frame pointer"
           frame_pointer = maybe_address
-        print "%s: %s %s" % (reader.FormatIntPtr(slot),
-                             reader.FormatIntPtr(maybe_address),
-                             maybe_symbol or "")
+        print "%s: %s %s %s" % (reader.FormatIntPtr(slot),
+                                reader.FormatIntPtr(maybe_address),
+                                "".join(ascii_content),
+                                maybe_symbol or "")
         if heap_object:
           heap_object.Print(Printer())
           print

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to