diff options
Diffstat (limited to 'lldb/scripts')
-rw-r--r-- | lldb/scripts/Python/python-swigsafecast.swig | 7 | ||||
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lldb/scripts/Python/python-swigsafecast.swig b/lldb/scripts/Python/python-swigsafecast.swig index 4813c4f8c4d..fee57cb75f3 100644 --- a/lldb/scripts/Python/python-swigsafecast.swig +++ b/lldb/scripts/Python/python-swigsafecast.swig @@ -126,3 +126,10 @@ SBTypeToSWIGWrapper (lldb::SBCommandReturnObject* cmd_ret_obj_sb) { return SWIG_NewPointerObj((void *) cmd_ret_obj_sb, SWIGTYPE_p_lldb__SBCommandReturnObject, 0); } + +template <> +PyObject* +SBTypeToSWIGWrapper (lldb::SBExecutionContext* ctx_sb) +{ + return SWIG_NewPointerObj((void *) ctx_sb, SWIGTYPE_p_lldb__SBExecutionContext, 0); +} diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 0c6382482c3..bf22198f4e4 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -770,13 +770,15 @@ LLDBSwigPythonCallCommand const char *session_dictionary_name, lldb::DebuggerSP& debugger, const char* args, - lldb_private::CommandReturnObject& cmd_retobj + lldb_private::CommandReturnObject& cmd_retobj, + lldb::ExecutionContextRefSP exe_ctx_ref_sp ) { lldb::SBCommandReturnObject cmd_retobj_sb(&cmd_retobj); SBCommandReturnObjectReleaser cmd_retobj_sb_releaser(cmd_retobj_sb); lldb::SBDebugger debugger_sb(debugger); + lldb::SBExecutionContext exe_ctx_sb(exe_ctx_ref_sp); bool retval = false; @@ -791,7 +793,12 @@ LLDBSwigPythonCallCommand // pass the pointer-to cmd_retobj_sb or watch the underlying object disappear from under you // see comment above for SBCommandReturnObjectReleaser for further details PyObject* pvalue = NULL; - pvalue = pfunc(debugger_sb, args, &cmd_retobj_sb, session_dict = FindSessionDictionary(session_dictionary_name)); + + PyCallable::argc argc = pfunc.GetNumArguments(); + if (argc.num_args == 5 || argc.varargs == true) + pvalue = pfunc(debugger_sb, args, exe_ctx_sb, &cmd_retobj_sb, session_dict = FindSessionDictionary(session_dictionary_name)); + else + pvalue = pfunc(debugger_sb, args, &cmd_retobj_sb, session_dict = FindSessionDictionary(session_dictionary_name)); Py_XINCREF (session_dict); Py_XDECREF (pvalue); |