summaryrefslogblamecommitdiff
path: root/src/generic/dumb_ptr.py
blob: b7973a7fe83cb925b816fe30df5138d995361d82 (plain) (tree)
1
2
3
4
5
6
7
8
9








                              
                                                                                            











                                                          
class dumb_ptr(object):
    __slots__ = ('_value')
    name = 'tmwa::dumb_ptr'
    enabled = True

    def __init__(self, value):
        self._value = value

    def to_string(self):
        return '0x%x' % long(self._value['impl'].cast(gdb.parse_and_eval('(long *)0').type))

    def children(self):
        try:
            sz = self._value['sz']
            yield 'sz', sz
        except gdb.error:
            pass

    tests = [
            ('tmwa::dumb_ptr<int>()', '0x0'),
            ('tmwa::dumb_ptr<int[]>()', '0x0 = {sz = 0}'),
    ]