Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,24 @@
import lldb
def pyobj_summary(value, unused):
if value is None or value.IsValid() == False or value.GetValueAsUnsigned(0) == 0:
return "<invalid>"
refcnt = value.GetChildMemberWithName("ob_refcnt")
expr = "(char*)PyString_AsString( (PyObject*)PyObject_Str( (PyObject*)0x%x) )" % (
value.GetValueAsUnsigned(0))
expr_summary = value.target.EvaluateExpression(
expr, lldb.SBExpressionOptions()).GetSummary()
refcnt_value = "rc = %d" % (refcnt.GetValueAsUnsigned(0))
return "%s (%s)" % (expr_summary, refcnt_value)
def __lldb_init_module(debugger, unused):
debugger.HandleCommand(
"type summary add PyObject --python-function pysummary.pyobj_summary")
debugger.HandleCommand(
"type summary add lldb_private::PythonObject -s ${var.m_py_obj%S}")
debugger.HandleCommand(
"type summary add lldb_private::PythonDictionary -s ${var.m_py_obj%S}")
debugger.HandleCommand(
"type summary add lldb_private::PythonString -s ${var.m_py_obj%S}")