We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1659b83 commit 0c4fbffCopy full SHA for 0c4fbff
1 file changed
Tools/gdb/libpython.py
@@ -53,7 +53,8 @@
53
_type_unsigned_short_ptr = gdb.lookup_type('unsigned short').pointer()
54
_type_unsigned_int_ptr = gdb.lookup_type('unsigned int').pointer()
55
56
-_is_pep393 = 'data' in [f.name for f in gdb.lookup_type('PyUnicodeObject').target().fields()]
+# value computed later, see PyUnicodeObjectPtr.proxy()
57
+_is_pep393 = None
58
59
SIZEOF_VOID_P = _type_void_ptr.sizeof
60
@@ -1123,6 +1124,10 @@ def char_width(self):
1123
1124
return _type_Py_UNICODE.sizeof
1125
1126
def proxyval(self, visited):
1127
+ global _is_pep393
1128
+ if _is_pep393 is None:
1129
+ fields = gdb.lookup_type('PyUnicodeObject').target().fields()
1130
+ _is_pep393 = 'data' in [f.name for f in fields]
1131
if _is_pep393:
1132
# Python 3.3 and newer
1133
may_have_surrogates = False
0 commit comments