diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2011-12-12 17:54:29 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2011-12-12 17:54:29 (GMT) |
commit | aa6c1d240fc4dd883b4c5a1564182e8fa90de496 (patch) | |
tree | 417976ca1ed9205f4dd9fc19768dfd93afff632a /Tools | |
parent | 9d57481f043cb9b94bfc45c1ee041415d915cf8a (diff) | |
download | cpython-aa6c1d240fc4dd883b4c5a1564182e8fa90de496.zip cpython-aa6c1d240fc4dd883b4c5a1564182e8fa90de496.tar.gz cpython-aa6c1d240fc4dd883b4c5a1564182e8fa90de496.tar.bz2 |
Issue #13575: there is only one class type.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/gdb/libpython.py | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 6972b9b..0eef228 100644 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -402,7 +402,7 @@ class ProxyAlreadyVisited(object): def _write_instance_repr(out, visited, name, pyop_attrdict, address): - '''Shared code for use by old-style and new-style classes: + '''Shared code for use by all classes: write a representation to file-like object "out"''' out.write('<') out.write(name) @@ -481,7 +481,7 @@ class HeapTypeObjectPtr(PyObjectPtr): def proxyval(self, visited): ''' - Support for new-style classes. + Support for classes. Currently we just locate the dictionary using a transliteration to python of _PyObject_GetDictPtr, ignoring descriptors @@ -498,7 +498,7 @@ class HeapTypeObjectPtr(PyObjectPtr): attr_dict = {} tp_name = self.safe_tp_name() - # New-style class: + # Class: return InstanceProxy(tp_name, attr_dict, long(self._gdbval)) def write_repr(self, out, visited): @@ -670,44 +670,6 @@ class PyDictObjectPtr(PyObjectPtr): pyop_value.write_repr(out, visited) out.write('}') -class PyInstanceObjectPtr(PyObjectPtr): - _typename = 'PyInstanceObject' - - def proxyval(self, visited): - # Guard against infinite loops: - if self.as_address() in visited: - return ProxyAlreadyVisited('<...>') - visited.add(self.as_address()) - - # Get name of class: - in_class = self.pyop_field('in_class') - cl_name = in_class.pyop_field('cl_name').proxyval(visited) - - # Get dictionary of instance attributes: - in_dict = self.pyop_field('in_dict').proxyval(visited) - - # Old-style class: - return InstanceProxy(cl_name, in_dict, long(self._gdbval)) - - def write_repr(self, out, visited): - # Guard against infinite loops: - if self.as_address() in visited: - out.write('<...>') - return - visited.add(self.as_address()) - - # Old-style class: - - # Get name of class: - in_class = self.pyop_field('in_class') - cl_name = in_class.pyop_field('cl_name').proxyval(visited) - - # Get dictionary of instance attributes: - pyop_in_dict = self.pyop_field('in_dict') - - _write_instance_repr(out, visited, - cl_name, pyop_in_dict, self.as_address()) - class PyListObjectPtr(PyObjectPtr): _typename = 'PyListObject' |