diff options
Diffstat (limited to 'src/strings/astring.py')
-rw-r--r-- | src/strings/astring.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/strings/astring.py b/src/strings/astring.py new file mode 100644 index 0000000..ec1dafe --- /dev/null +++ b/src/strings/astring.py @@ -0,0 +1,24 @@ +class AString(object): + ''' print an AString + ''' + __slots__ = ('_value') + name = '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) |