summaryrefslogblamecommitdiff
path: root/src/strings/astring.py
blob: 063e721e1986c74d71cbe512335f305b4eb7d085 (plain) (tree)
1
2
3
4
5



                          
                                   


















                                                                     
class AString(object):
    ''' print an AString
    '''
    __slots__ = ('_value')
    name = 'tmwa::strings::AString'
    enabled = True

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

    def to_string(self):
        return None

    def children(self):
        b = self._value['data']
        s = self._value['special']
        if s == 255:
            b = b.cast(gdb.lookup_type('strings::RString').pointer())
            yield 'allocated', b.dereference()
        else:
            b = b.cast(b.type.target().pointer())
            n = 255
            d = n - s
            yield 'contained', b.lazy_string(length=d)