summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-extensions.swig
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
-rw-r--r--lldb/scripts/Python/python-extensions.swig13
1 files changed, 9 insertions, 4 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
+%}
OpenPOWER on IntegriCloud