[Libreoffice-commits] core.git: 2 commits - solenv/lldb
Michael Stahl
mstahl at redhat.com
Mon Sep 26 16:02:20 UTC 2016
solenv/lldb/libreoffice/LO.py | 56 ++++++++++++++++++++++++++++++------------
1 file changed, 40 insertions(+), 16 deletions(-)
New commits:
commit bdf2c5932c081bbd028d2defaf576f93dc157a36
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Sep 26 17:54:26 2016 +0200
LLDB remove pretty-printing of long obsolete String class
Change-Id: I8574c0b731efecb174370d09cfea2c89c27ab974
diff --git a/solenv/lldb/libreoffice/LO.py b/solenv/lldb/libreoffice/LO.py
index 397d115..3c1134c 100644
--- a/solenv/lldb/libreoffice/LO.py
+++ b/solenv/lldb/libreoffice/LO.py
@@ -68,20 +68,6 @@ def rtl_uString_summary(valobj, dict):
def rtl_OUString_summary(valobj, dict):
return rtl_uString_summary(valobj.GetChildMemberWithName('pData'), dict)
-def UniStringData_summary(valobj, dict):
- if valobj.TypeIsPointerType():
- return UniStringData_summary(valobj.Dereference(), dict)
-
- length = valobj.GetChildMemberWithName('mnLen').GetValueAsUnsigned(0)
- buffer = valobj.GetChildMemberWithName('maStr')
-
- buffer_ptr = buffer.AddressOf();
-
- return sal_unicode_string(buffer_ptr, length)
-
-def String_summary(valobj, dict):
- return UniStringData_summary(valobj.GetChildMemberWithName('mpData'), dict)
-
def sal_unicode_string(buffer_ptr, length):
e = lldb.SBError()
@@ -116,7 +102,5 @@ def __lldb_init_module(debugger, dict):
debugger.HandleCommand("type summary add --skip-pointers --skip-references --python-function LO.rtl_OString_summary rtl::OString")
debugger.HandleCommand("type summary add --skip-references --python-function LO.rtl_uString_summary rtl_uString")
debugger.HandleCommand("type summary add --skip-pointers --skip-references --python-function LO.rtl_OUString_summary rtl::OUString")
- debugger.HandleCommand("type summary add --skip-references --python-function LO.UniStringData_summary UniStringData")
- debugger.HandleCommand("type summary add --skip-pointers --skip-references --python-function LO.String_summary String")
# vim:set shiftwidth=4 softtabstop=4 expandtab:
commit 79afde9b14e65c7c074617e63a094d911d0bc78f
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Sep 26 17:53:21 2016 +0200
LLDB pretty print rtl_String / OString too
Change-Id: Iaf77d03d8116273054ae3efca88f44fd926bf211
diff --git a/solenv/lldb/libreoffice/LO.py b/solenv/lldb/libreoffice/LO.py
index 10d368f..397d115 100644
--- a/solenv/lldb/libreoffice/LO.py
+++ b/solenv/lldb/libreoffice/LO.py
@@ -12,6 +12,44 @@
import lldb
+def rtl_String_summary(valobj, dict):
+ if valobj.TypeIsPointerType():
+ return rtl_String_summary(valobj.Dereference(), dict)
+
+ length = valobj.GetChildMemberWithName('length').GetValueAsUnsigned(0)
+ buffer = valobj.GetChildMemberWithName('buffer')
+ buffer_ptr = buffer.AddressOf();
+
+# return '"' + buffer_ptr.GetPointeeData(0, length).GetString(lldb.SBError(), 0) + '"'
+ return sal_ascii_string(buffer_ptr, length)
+
+def rtl_OString_summary(valobj, dict):
+ return rtl_String_summary(valobj.GetChildMemberWithName('pData'), dict)
+
+def sal_ascii_string(buffer_ptr, length):
+ e = lldb.SBError()
+
+ s = '"'
+ i = 0
+ while i < length:
+ c = buffer_ptr.GetPointeeData(i, 1).GetUnsignedInt8(e, 0)
+ if c == ord('"'): s = s + '\\"'
+ elif c == ord('\\'): s = s + '\\\\'
+ elif c == ord('\n'): s = s + '\\n'
+ elif c == ord('\r'): s = s + '\\r'
+ elif c == ord('\t'):
+ s = s + '\\t'
+ elif c < ord(' '):
+ s = s + '\\{:03o}'.format(c)
+ elif c < 127:
+ s = s + chr(c)
+ else:
+ s = s + '\\u{:04x}'.format(c)
+ i = i + 1
+ s = s + '"'
+
+ return s
+
def rtl_uString_summary(valobj, dict):
# print "valobj = " + str(valobj) + ", valobj.GetData() = " + str(valobj.GetData()) + ", valobj.GetTypeName() = " + str(valobj.GetTypeName())
@@ -74,6 +112,8 @@ def sal_unicode_string(buffer_ptr, length):
# Automatically install the above summary functions when this is loaded
def __lldb_init_module(debugger, dict):
+ debugger.HandleCommand("type summary add --skip-references --python-function LO.rtl_String_summary rtl_String")
+ debugger.HandleCommand("type summary add --skip-pointers --skip-references --python-function LO.rtl_OString_summary rtl::OString")
debugger.HandleCommand("type summary add --skip-references --python-function LO.rtl_uString_summary rtl_uString")
debugger.HandleCommand("type summary add --skip-pointers --skip-references --python-function LO.rtl_OUString_summary rtl::OUString")
debugger.HandleCommand("type summary add --skip-references --python-function LO.UniStringData_summary UniStringData")
More information about the Libreoffice-commits
mailing list