From: yangguo@chromium.org Date: Tue, 3 Jul 2012 11:56:30 +0000 (+0000) Subject: Add function to grokdump shell to print ASCII string. X-Git-Tag: upstream/4.7.83~16421 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec4ab693c27ee57b2027bb7bb8243d055a33a665;p=platform%2Fupstream%2Fv8.git Add function to grokdump shell to print ASCII string. R=mstarzinger@chromium.org BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10697067 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/tools/grokdump.py b/tools/grokdump.py index 59a2a4871..24c9c5a92 100755 --- a/tools/grokdump.py +++ b/tools/grokdump.py @@ -1522,6 +1522,24 @@ class InspectionShell(cmd.Cmd): else: print "Page header is not available!" + def do_da(self, address): + """ + Print ASCII string starting at specified address. + """ + address = int(address, 16) + string = "" + while self.reader.IsValidAddress(address): + code = self.reader.ReadU8(address) + if code < 128: + string += chr(code) + else: + break + address += 1 + if string == "": + print "Not an ASCII string at %s" % self.reader.FormatIntPtr(address) + else: + print "%s\n" % string + def do_k(self, arguments): """ Teach V8 heap layout information to the inspector. This increases