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().
| 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)) |
no outgoing calls
no test coverage detected
searching dependent graphs…