From 7e4df56aae9256aab00ceb24bf26b30d2ed6900b Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Sat, 22 Nov 2014 00:02:47 +0000 Subject: Enable Python summaries to use custom SBTypeSummaryOptions if the user is so inclined. Updates to the webdoc will follow llvm-svn: 222593 --- lldb/scripts/Python/python-swigsafecast.swig | 7 +++++++ lldb/scripts/Python/python-wrapper.swig | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'lldb/scripts/Python') diff --git a/lldb/scripts/Python/python-swigsafecast.swig b/lldb/scripts/Python/python-swigsafecast.swig index fee57cb..ea3f21f 100644 --- a/lldb/scripts/Python/python-swigsafecast.swig +++ b/lldb/scripts/Python/python-swigsafecast.swig @@ -133,3 +133,10 @@ SBTypeToSWIGWrapper (lldb::SBExecutionContext* ctx_sb) { return SWIG_NewPointerObj((void *) ctx_sb, SWIGTYPE_p_lldb__SBExecutionContext, 0); } + +template <> +PyObject* +SBTypeToSWIGWrapper (lldb::SBTypeSummaryOptions* summary_options_sb) +{ + return SWIG_NewPointerObj((void *) summary_options_sb, SWIGTYPE_p_lldb__SBTypeSummaryOptions, 0); +} diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 1eaa52b..84375fd 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -342,10 +342,12 @@ LLDBSwigPythonCallTypeScript const void *session_dictionary, const lldb::ValueObjectSP& valobj_sp, void** pyfunct_wrapper, + const lldb::TypeSummaryOptionsSP& options_sp, std::string& retval ) { lldb::SBValue sb_value (valobj_sp); + lldb::SBTypeSummaryOptions sb_options(options_sp.get()); retval.clear(); @@ -384,7 +386,14 @@ LLDBSwigPythonCallTypeScript if (!pfunc) return false; - + + // if the third argument is supported, or varargs are allowed + PyCallable::argc argc = pfunc.GetNumArguments(); + if (argc.num_args == 3 || argc.varargs == true) + pvalue = pfunc(sb_value,session_dict,sb_options); + else + pvalue = pfunc(sb_value,session_dict); + pvalue = pfunc(sb_value,session_dict); Py_INCREF (session_dict); -- cgit v1.1