MCPcopy Index your code
hub / github.com/python/cpython / proxyval

Method proxyval

Tools/gdb/libpython.py:533–557  ·  view source on GitHub ↗

Support for classes. Currently we just locate the dictionary using a transliteration to python of _PyObject_GetDictPtr, ignoring descriptors

(self, visited)

Source from the content-addressed store, hash-verified

531 return typeobj._gdbval.cast(HeapTypePtr)['ht_cached_keys']
532
533 def proxyval(self, visited):
534 '''
535 Support for classes.
536
537 Currently we just locate the dictionary using a transliteration to
538 python of _PyObject_GetDictPtr, ignoring descriptors
539 '''
540 # Guard against infinite loops:
541 if self.as_address() in visited:
542 return ProxyAlreadyVisited('<...>')
543 visited.add(self.as_address())
544
545 keys_values = self.get_keys_values()
546 if keys_values:
547 attr_dict = keys_values.proxyval(visited)
548 else:
549 pyop_attr_dict = self.get_attr_dict()
550 if pyop_attr_dict:
551 attr_dict = pyop_attr_dict.proxyval(visited)
552 else:
553 attr_dict = {}
554 tp_name = self.safe_tp_name()
555
556 # Class:
557 return InstanceProxy(tp_name, attr_dict, int(self._gdbval))
558
559 def write_repr(self, out, visited):
560 # Guard against infinite loops:

Callers

nothing calls this directly

Calls 8

get_keys_valuesMethod · 0.95
get_attr_dictMethod · 0.95
ProxyAlreadyVisitedClass · 0.85
InstanceProxyClass · 0.85
as_addressMethod · 0.45
addMethod · 0.45
proxyvalMethod · 0.45
safe_tp_nameMethod · 0.45

Tested by

no test coverage detected