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

Class FakeRepr

Tools/gdb/libpython.py:285–302  ·  view source on GitHub ↗

Class representing a non-descript PyObject* value in the inferior process for when we don't have a custom scraper, intended to have a sane repr().

Source from the content-addressed store, hash-verified

283 '''
284
285 class FakeRepr(object):
286 """
287 Class representing a non-descript PyObject* value in the inferior
288 process for when we don't have a custom scraper, intended to have
289 a sane repr().
290 """
291
292 def __init__(self, tp_name, address):
293 self.tp_name = tp_name
294 self.address = address
295
296 def __repr__(self):
297 # For the NULL pointer, we have no way of knowing a type, so
298 # special-case it as per
299 # http://bugs.python.org/issue8032#msg100882
300 if self.address == 0:
301 return '0x0'
302 return '<%s at remote 0x%x>' % (self.tp_name, self.address)
303
304 return FakeRepr(self.safe_tp_name(),
305 int(self._gdbval))

Callers 1

proxyvalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…