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): |