lldb4aoo.py (6f79f796) lldb4aoo.py (f4289c07)
1# to activate the AOO-LLDB helper script type the line below into LLDB
2# command script import path-to-script/lldb4aoo.py
3# or activate it automatically by adding the line to ~/.lldbinit
4
5def __lldb_init_module( dbg, dict):
6 # the list of AOO specific types
7 aoo_types = ['rtl_String', 'rtl_uString', '_ByteStringData', '_UniStringData']
8 pimpl_types = ['rtl::OString', 'rtl::OUString', 'ByteString', 'UniString']

--- 52 unchanged lines hidden (view full) ---

61
62def ret_strdata_info( v, refvar, lenvar, aryvar):
63 (v, info) = walk_ptrchain( v)
64 if not v:
65 return info
66 r = v.GetChildMemberWithName( refvar).GetValueAsSigned()
67 l = v.GetChildMemberWithName( lenvar).GetValueAsSigned()
68 c = v.GetChildMemberWithName( aryvar)
1# to activate the AOO-LLDB helper script type the line below into LLDB
2# command script import path-to-script/lldb4aoo.py
3# or activate it automatically by adding the line to ~/.lldbinit
4
5def __lldb_init_module( dbg, dict):
6 # the list of AOO specific types
7 aoo_types = ['rtl_String', 'rtl_uString', '_ByteStringData', '_UniStringData']
8 pimpl_types = ['rtl::OString', 'rtl::OUString', 'ByteString', 'UniString']

--- 52 unchanged lines hidden (view full) ---

61
62def ret_strdata_info( v, refvar, lenvar, aryvar):
63 (v, info) = walk_ptrchain( v)
64 if not v:
65 return info
66 r = v.GetChildMemberWithName( refvar).GetValueAsSigned()
67 l = v.GetChildMemberWithName( lenvar).GetValueAsSigned()
68 c = v.GetChildMemberWithName( aryvar)
69 if (r < 0) or (l < 0):
70 info += 'CORRUPT_STR={refs=%d, len=%d}' % (r,l)
71 return info
69 L = min(l,128)
70 d = c.AddressOf().GetPointeeData( 0, L)
71 if c.GetByteSize() == 1: # assume UTF-8
72 s = ''.join([chr(x) for x in d.uint8s])
73 else: # assume UTF-16
74 s = (u''.join([unichr(x) for x in d.uint16s])).encode('utf-8')
75 info += ('{refs=%d, len=%d, str="%s"%s}' % (r, l, s.encode('string_escape'), '...'if(l!=L)else''))
76 return info

--- 26 unchanged lines hidden ---
72 L = min(l,128)
73 d = c.AddressOf().GetPointeeData( 0, L)
74 if c.GetByteSize() == 1: # assume UTF-8
75 s = ''.join([chr(x) for x in d.uint8s])
76 else: # assume UTF-16
77 s = (u''.join([unichr(x) for x in d.uint16s])).encode('utf-8')
78 info += ('{refs=%d, len=%d, str="%s"%s}' % (r, l, s.encode('string_escape'), '...'if(l!=L)else''))
79 return info

--- 26 unchanged lines hidden ---