summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBTypeSummary.h4
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreter.h2
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreterPython.h1
-rw-r--r--lldb/include/lldb/lldb-forward.h1
-rw-r--r--lldb/scripts/Python/python-swigsafecast.swig7
-rw-r--r--lldb/scripts/Python/python-wrapper.swig11
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp1
-rw-r--r--lldb/source/DataFormatters/TypeSummary.cpp1
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp4
9 files changed, 29 insertions, 3 deletions
diff --git a/lldb/include/lldb/API/SBTypeSummary.h b/lldb/include/lldb/API/SBTypeSummary.h
index 48128b0a256..220451e6d70 100644
--- a/lldb/include/lldb/API/SBTypeSummary.h
+++ b/lldb/include/lldb/API/SBTypeSummary.h
@@ -22,6 +22,8 @@ namespace lldb {
SBTypeSummaryOptions (const lldb::SBTypeSummaryOptions &rhs);
+ SBTypeSummaryOptions (const lldb_private::TypeSummaryOptions *lldb_object_ptr);
+
~SBTypeSummaryOptions ();
bool
@@ -57,8 +59,6 @@ namespace lldb {
const lldb_private::TypeSummaryOptions &
ref() const;
- SBTypeSummaryOptions (const lldb_private::TypeSummaryOptions *lldb_object_ptr);
-
void
SetOptions (const lldb_private::TypeSummaryOptions *lldb_object_ptr);
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index e1b764767b7..35ba9491ded 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -98,6 +98,7 @@ public:
void *session_dictionary,
const lldb::ValueObjectSP& valobj_sp,
void** pyfunct_wrapper,
+ const lldb::TypeSummaryOptionsSP& options,
std::string& retval);
typedef void* (*SWIGPythonCreateSyntheticProvider) (const char *python_class_name,
@@ -462,6 +463,7 @@ public:
GetScriptedSummary (const char *function_name,
lldb::ValueObjectSP valobj,
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
+ const TypeSummaryOptions& options,
std::string& retval)
{
return false;
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
index 3890264f67d..edcc4c44fac 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
@@ -190,6 +190,7 @@ public:
GetScriptedSummary (const char *function_name,
lldb::ValueObjectSP valobj,
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
+ const TypeSummaryOptions& options,
std::string& retval);
virtual void
diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h
index ed4aa92d179..e21091ce17a 100644
--- a/lldb/include/lldb/lldb-forward.h
+++ b/lldb/include/lldb/lldb-forward.h
@@ -402,6 +402,7 @@ namespace lldb {
typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;
typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;
typedef std::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP;
+ typedef std::shared_ptr<lldb_private::TypeSummaryOptions> TypeSummaryOptionsSP;
typedef std::shared_ptr<lldb_private::TypeValidatorImpl> TypeValidatorImplSP;
#ifndef LLDB_DISABLE_PYTHON
typedef std::shared_ptr<lldb_private::ScriptedSyntheticChildren> ScriptedSyntheticChildrenSP;
diff --git a/lldb/scripts/Python/python-swigsafecast.swig b/lldb/scripts/Python/python-swigsafecast.swig
index fee57cb75f3..ea3f21f859a 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 1eaa52ba246..84375fd1547 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);
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index e9e5b1fa972..193d06e4d92 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -594,6 +594,7 @@ LLDBSwigPythonCallTypeScript (const char *python_function_name,
void *session_dictionary,
const lldb::ValueObjectSP& valobj_sp,
void** pyfunct_wrapper,
+ const lldb::TypeSummaryOptionsSP& options_sp,
std::string& retval);
extern "C" void*
diff --git a/lldb/source/DataFormatters/TypeSummary.cpp b/lldb/source/DataFormatters/TypeSummary.cpp
index 061a0413f0e..ff089af58cb 100644
--- a/lldb/source/DataFormatters/TypeSummary.cpp
+++ b/lldb/source/DataFormatters/TypeSummary.cpp
@@ -237,6 +237,7 @@ ScriptSummaryFormat::FormatObject (ValueObject *valobj,
return script_interpreter->GetScriptedSummary(m_function_name.c_str(),
valobj->GetSP(),
m_script_function_sp,
+ options,
retval);
}
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index b340cc5faa9..d53a16bc820 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -1860,6 +1860,7 @@ bool
ScriptInterpreterPython::GetScriptedSummary (const char *python_function_name,
lldb::ValueObjectSP valobj,
lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
+ const TypeSummaryOptions& options,
std::string& retval)
{
@@ -1881,11 +1882,14 @@ ScriptInterpreterPython::GetScriptedSummary (const char *python_function_name,
{
Locker py_lock(this, Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
{
+ TypeSummaryOptionsSP options_sp(new TypeSummaryOptions(options));
+
Timer scoped_timer ("g_swig_typescript_callback","g_swig_typescript_callback");
ret_val = g_swig_typescript_callback (python_function_name,
GetSessionDictionary().get(),
valobj,
&new_callee,
+ options_sp,
retval);
}
}
OpenPOWER on IntegriCloud