Fix an issue where the @lldb.command marker would not work with the new 5-argument version of the Python command function

This:
a) teaches PythonCallable to look inside a callable object
b) teaches PythonCallable to discover whether a callable method is bound
c) teaches lldb.command to dispatch to either the older 4 argument version or the newer 5 argument version

llvm-svn: 273640
This commit is contained in:
Enrico Granata
2016-06-24 02:07:15 +00:00
parent 68f7f1cf00
commit a5d6765cb0
4 changed files with 36 additions and 6 deletions

View File

@@ -610,7 +610,7 @@ LLDBSwigPythonCallCommand
PythonObject exe_ctx_arg(PyRefType::Owned, SBTypeToSWIGWrapper(exe_ctx_sb));
PythonObject cmd_retobj_arg(PyRefType::Owned, SBTypeToSWIGWrapper(&cmd_retobj_sb));
if (argc.count == 5 || argc.has_varargs)
if (argc.count == 5 || argc.is_bound_method || argc.has_varargs)
pfunc(debugger_arg, PythonString(args), exe_ctx_arg, cmd_retobj_arg, dict);
else
pfunc(debugger_arg, PythonString(args), cmd_retobj_arg, dict);