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

Unified Diff: Tools/gdb/webkit.py

Issue 313833003: Tools gdb script renamed class xrange to range for python3.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replaced xrange with range for python3.0 Created 6 years, 6 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/gdb/webkit.py
diff --git a/Tools/gdb/webkit.py b/Tools/gdb/webkit.py
index e0219f021de82f74a569eafd13f75f1c6aa440b1..ef4680327d98324697d0310cdf5bbd0d1d411f4d 100644
--- a/Tools/gdb/webkit.py
+++ b/Tools/gdb/webkit.py
@@ -41,14 +41,13 @@ import gdb
import re
import struct
-
def guess_string_length(ptr):
"""Guess length of string pointed by ptr.
Returns a tuple of (length, an error message).
"""
# Try to guess at the length.
- for i in xrange(0, 2048):
+ for i in range(0, 2048):
try:
if int((ptr + i).dereference()) == 0:
return i, ''
@@ -68,7 +67,7 @@ def ustring_to_string(ptr, length=None):
length, error_message = guess_string_length(ptr)
else:
length = int(length)
- char_vals = [int((ptr + i).dereference()) for i in xrange(length)]
+ char_vals = [int((ptr + i).dereference()) for i in range(length)]
string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace').encode('utf-8')
return string + error_message
@@ -83,7 +82,7 @@ def lstring_to_string(ptr, length=None):
length, error_message = guess_string_length(ptr)
else:
length = int(length)
- string = ''.join([chr((ptr + i).dereference()) for i in xrange(length)])
+ string = ''.join([chr((ptr + i).dereference()) for i in range(length)])
return string + error_message
@@ -120,7 +119,7 @@ class WTFCStringPrinter(StringPrinter):
# The CString holds a buffer, which is a refptr to a WTF::CStringBuffer.
data = self.val['m_buffer']['m_ptr']['m_data'].cast(gdb.lookup_type('char').pointer())
length = self.val['m_buffer']['m_ptr']['m_length']
- return ''.join([chr((data + i).dereference()) for i in xrange(length)])
+ return ''.join([chr((data + i).dereference()) for i in range(length)])
class WTFStringImplPrinter(StringPrinter):
« 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