summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-04-21 13:53:05 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-04-21 13:53:05 (GMT)
commit67df3a4b7eb67f8c7d7631ba2d0704fe9210d98c (patch)
tree381bc4518a42532f8b5045e9a05d38e0f77ff091 /Tools
parente212416420e446d21dc8b8ecd4e26e5df896d5a3 (diff)
downloadcpython-67df3a4b7eb67f8c7d7631ba2d0704fe9210d98c.zip
cpython-67df3a4b7eb67f8c7d7631ba2d0704fe9210d98c.tar.gz
cpython-67df3a4b7eb67f8c7d7631ba2d0704fe9210d98c.tar.bz2
Adapt libpython.py and test_gdb.py to Python3
* Rename PyStringObjectPtr to PyBytesObjectPtr * Replace PyObject_Print by textiowrapper_write
Diffstat (limited to 'Tools')
-rw-r--r--Tools/gdb/libpython.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index f62735f..a8f28d7 100644
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -19,7 +19,7 @@ giving file/line information and the state of local variables
In particular, given a gdb.Value corresponding to a PyObject* in the inferior
process, we can generate a "proxy value" within the gdb process. For example,
given a PyObject* in the inferior process that is in fact a PyListObject*
-holding three PyObject* that turn out to be PyStringObject* instances, we can
+holding three PyObject* that turn out to be PyBytesObject* instances, we can
generate a proxy value within the gdb process that is a list of strings:
["foo", "bar", "baz"]
@@ -108,7 +108,7 @@ class TruncatedStringIO(object):
class PyObjectPtr(object):
"""
Class wrapping a gdb.Value that's a either a (PyObject*) within the
- inferior process, or some subclass pointer e.g. (PyStringObject*)
+ inferior process, or some subclass pointer e.g. (PyBytesObject*)
There will be a subclass for every refined PyObject type that we care
about.
@@ -319,7 +319,7 @@ class PyObjectPtr(object):
if tp_flags & Py_TPFLAGS_TUPLE_SUBCLASS:
return PyTupleObjectPtr
if tp_flags & Py_TPFLAGS_STRING_SUBCLASS:
- return PyStringObjectPtr
+ return PyBytesObjectPtr
if tp_flags & Py_TPFLAGS_UNICODE_SUBCLASS:
return PyUnicodeObjectPtr
if tp_flags & Py_TPFLAGS_DICT_SUBCLASS:
@@ -958,8 +958,8 @@ class PySetObjectPtr(PyObjectPtr):
out.write('])')
-class PyStringObjectPtr(PyObjectPtr):
- _typename = 'PyStringObject'
+class PyBytesObjectPtr(PyObjectPtr):
+ _typename = 'PyBytesObject'
def __str__(self):
field_ob_size = self.field('ob_size')