summaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-14 15:00:12 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-15 21:50:46 -0700
commit3fa6f4b4c400c7354e05ac7bae128d4d9ee30e5c (patch)
treec6b3f39e51aeaf6ff04061bb264211086e7e3fcc /src/strings
parent60d9e17f3719eca2eb4531f9f01976b1e26c411b (diff)
downloadtmwa-3fa6f4b4c400c7354e05ac7bae128d4d9ee30e5c.tar.gz
tmwa-3fa6f4b4c400c7354e05ac7bae128d4d9ee30e5c.tar.bz2
tmwa-3fa6f4b4c400c7354e05ac7bae128d4d9ee30e5c.tar.xz
tmwa-3fa6f4b4c400c7354e05ac7bae128d4d9ee30e5c.zip
Add infrastructure for debug pretty printers
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/zstring.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/strings/zstring.py b/src/strings/zstring.py
new file mode 100644
index 0000000..5021e1c
--- /dev/null
+++ b/src/strings/zstring.py
@@ -0,0 +1,18 @@
+class ZString(object):
+ ''' print a ZString
+ '''
+ __slots__ = ('_value')
+ name = 'strings::ZString'
+ enabled = True
+
+ def __init__(self, value):
+ self._value = value
+
+ def children(self):
+ yield 'base', self._value['_base']
+
+ def to_string(self):
+ b = self._value['_b']['_ptr']
+ e = self._value['_e']['_ptr']
+ d = e - b
+ return b.lazy_string(length=d)