diff options
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 13 | ||||
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 1e43e53a514..487bf1e3599 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -810,6 +810,7 @@ def command(*args, **kwargs): import lldb + import inspect """A decorator function that registers an LLDB command line command that is bound to the function it is attached to.""" class obj(object): @@ -821,11 +822,15 @@ def command(*args, **kwargs): command = "command script add -f %s.%s %s" % (function.__module__, function.__name__, command_name) lldb.debugger.HandleCommand(command) self.function = function - def __call__(self, *args, **kwargs): - self.function(*args, **kwargs) + def __call__(self, debugger, command, exe_ctx, result, dict): + if len(inspect.getargspec(self.function).args) == 5: + self.function(debugger, command, exe_ctx, result, dict) + else: + self.function(debugger, command, result, dict) def callable(function): """Creates a callable object that gets used.""" - return obj(function, *args, **kwargs) + f = obj(function, *args, **kwargs) + return f.__call__ return callable class declaration(object): @@ -1129,4 +1134,4 @@ def is_numeric_type(basic_type): #if basic_type == eBasicTypeOther: return (False,False) -%}
\ No newline at end of file +%} diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 5d7bfaa8943..a92102e3283 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -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); |