lldb4aoo.py (f174ccd1) lldb4aoo.py (0d72dfe8)
1# to activate run the command below when inside lldb
2# command script import /tools/lldb4aoo.py
3# or add the line to ~/.lldbinit to always activate it
4
5def __lldb_init_module( dbg, dict):
6 # the list of AOO specific types
7 aoo_types = ['rtl_String', 'rtl::OString', 'rtl_uString', 'rtl::OUString',
8 '_ByteStringData', '_UniStringData', 'ByteString', 'UniString']

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

40 while valobj.TypeIsPointerType():
41 valobj = valobj.Dereference()
42 r = valobj.GetChildMemberWithName('refCount').GetValueAsSigned()
43 l = valobj.GetChildMemberWithName('length').GetValueAsSigned()
44 a = valobj.GetChildMemberWithName('buffer').AddressOf().GetPointeeData(0,l)
45 s = (u''.join([unichr(x) for x in a.uint16s])).encode('utf-8')
46 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
47
1# to activate run the command below when inside lldb
2# command script import /tools/lldb4aoo.py
3# or add the line to ~/.lldbinit to always activate it
4
5def __lldb_init_module( dbg, dict):
6 # the list of AOO specific types
7 aoo_types = ['rtl_String', 'rtl::OString', 'rtl_uString', 'rtl::OUString',
8 '_ByteStringData', '_UniStringData', 'ByteString', 'UniString']

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

40 while valobj.TypeIsPointerType():
41 valobj = valobj.Dereference()
42 r = valobj.GetChildMemberWithName('refCount').GetValueAsSigned()
43 l = valobj.GetChildMemberWithName('length').GetValueAsSigned()
44 a = valobj.GetChildMemberWithName('buffer').AddressOf().GetPointeeData(0,l)
45 s = (u''.join([unichr(x) for x in a.uint16s])).encode('utf-8')
46 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
47
48def getinfo_for_rtl__ByteStringData( valobj, dict):
48def getinfo_for__ByteStringData( valobj, dict):
49 while valobj.TypeIsPointerType():
50 valobj = valobj.Dereference()
51 r = valobj.GetChildMemberWithName('mnRefCount').GetValueAsSigned()
52 l = valobj.GetChildMemberWithName('mnLen').GetValueAsSigned()
53 a = valobj.GetChildMemberWithName('maStr').AddressOf().GetPointeeData(0,l)
54 s = ''.join([chr(x) for x in a.uint8s])
55 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
56
49 while valobj.TypeIsPointerType():
50 valobj = valobj.Dereference()
51 r = valobj.GetChildMemberWithName('mnRefCount').GetValueAsSigned()
52 l = valobj.GetChildMemberWithName('mnLen').GetValueAsSigned()
53 a = valobj.GetChildMemberWithName('maStr').AddressOf().GetPointeeData(0,l)
54 s = ''.join([chr(x) for x in a.uint8s])
55 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
56
57def getinfo_for_rtl__UniStringData( valobj, dict):
57def getinfo_for__UniStringData( valobj, dict):
58 while valobj.TypeIsPointerType():
59 valobj = valobj.Dereference()
60 r = valobj.GetChildMemberWithName('mnRefCount').GetValueAsSigned()
61 l = valobj.GetChildMemberWithName('mnLen').GetValueAsSigned()
62 a = valobj.GetChildMemberWithName('maStr').AddressOf().GetPointeeData(0,l)
63 s = (u''.join([unichr(x) for x in a.uint16s])).encode('utf-8')
64 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
65
66
67def getinfo_for_rtl_OString( valobj, dict):
68 d = valobj.GetChildMemberWithName('pData')
69 return d.Dereference()
70
71def getinfo_for_rtl_OUString( valobj, dict):
72 d = valobj.GetChildMemberWithName('pData')
73 return d.Dereference()
74
58 while valobj.TypeIsPointerType():
59 valobj = valobj.Dereference()
60 r = valobj.GetChildMemberWithName('mnRefCount').GetValueAsSigned()
61 l = valobj.GetChildMemberWithName('mnLen').GetValueAsSigned()
62 a = valobj.GetChildMemberWithName('maStr').AddressOf().GetPointeeData(0,l)
63 s = (u''.join([unichr(x) for x in a.uint16s])).encode('utf-8')
64 return '{refs=%d, len=%d, str="%s"}'%(r,l,s)
65
66
67def getinfo_for_rtl_OString( valobj, dict):
68 d = valobj.GetChildMemberWithName('pData')
69 return d.Dereference()
70
71def getinfo_for_rtl_OUString( valobj, dict):
72 d = valobj.GetChildMemberWithName('pData')
73 return d.Dereference()
74
75def getinfo_for_rtl_ByteString( valobj, dict):
75def getinfo_for_ByteString( valobj, dict):
76 d = valobj.GetChildMemberWithName('mpData')
77 return d.Dereference()
78
76 d = valobj.GetChildMemberWithName('mpData')
77 return d.Dereference()
78
79def getinfo_for_rtl_UniString( valobj, dict):
79def getinfo_for_UniString( valobj, dict):
80 d = valobj.GetChildMemberWithName('mpData')
81 return d.Dereference()
82
80 d = valobj.GetChildMemberWithName('mpData')
81 return d.Dereference()
82