3 # bunch of different kinds of python callables that should
4 # all work as commands.
7 def check(debugger
, command
, context
, result
, internal_dict
):
9 not isinstance(debugger
, lldb
.SBDebugger
)
10 or not isinstance(command
, str)
11 or not isinstance(result
, lldb
.SBCommandReturnObject
)
12 or not isinstance(internal_dict
, dict)
13 or (not context
is None and not isinstance(context
, lldb
.SBExecutionContext
))
16 result
.AppendMessage("All good.")
23 def v5foobar(debugger
, command
, context
, result
, internal_dict
, *args
):
24 check(debugger
, command
, context
, result
, internal_dict
)
27 def foobar(debugger
, command
, context
, result
, internal_dict
):
28 check(debugger
, command
, context
, result
, internal_dict
)
31 def foobar4(debugger
, command
, result
, internal_dict
):
32 check(debugger
, command
, None, result
, internal_dict
)
37 def sfoobar(debugger
, command
, context
, result
, internal_dict
):
38 check(debugger
, command
, context
, result
, internal_dict
)
41 def cfoobar(cls
, debugger
, command
, context
, result
, internal_dict
):
42 check(debugger
, command
, context
, result
, internal_dict
)
44 def ifoobar(self
, debugger
, command
, context
, result
, internal_dict
):
45 check(debugger
, command
, context
, result
, internal_dict
)
47 def __call__(self
, debugger
, command
, context
, result
, internal_dict
):
48 check(debugger
, command
, context
, result
, internal_dict
)
51 def sfoobar4(debugger
, command
, result
, internal_dict
):
52 check(debugger
, command
, None, result
, internal_dict
)
55 def cfoobar4(cls
, debugger
, command
, result
, internal_dict
):
56 check(debugger
, command
, None, result
, internal_dict
)
58 def ifoobar4(self
, debugger
, command
, result
, internal_dict
):
59 check(debugger
, command
, None, result
, internal_dict
)
63 def __call__(self
, debugger
, command
, result
, internal_dict
):
64 check(debugger
, command
, None, result
, internal_dict
)
69 FooBar4Obj
= FooBar4()