Dont include shell commands in the list of commands.

pull/24/head
Zach Riggle 10 years ago
parent c6f0705e3b
commit d213c484a1

@ -24,11 +24,13 @@ class _Command(gdb.Command):
count = 0 count = 0
commands = [] commands = []
def __init__(self, function): def __init__(self, function, inc=True):
super(_Command, self).__init__(function.__name__, gdb.COMMAND_USER, gdb.COMPLETE_EXPRESSION) super(_Command, self).__init__(function.__name__, gdb.COMMAND_USER, gdb.COMPLETE_EXPRESSION)
self.function = function self.function = function
self.commands.append(self) if inc:
self.commands.append(self)
functools.update_wrapper(self, function) functools.update_wrapper(self, function)
self.__doc__ = function.__doc__ self.__doc__ = function.__doc__
@ -86,11 +88,11 @@ def OnlyWhenRunning(function):
print("Only available when running") print("Only available when running")
return _OnlyWhenRunning return _OnlyWhenRunning
def Command(func): def Command(func, *a, **kw):
class C(_Command): class C(_Command):
__doc__ = func.__doc__ __doc__ = func.__doc__
__name__ = func.__name__ __name__ = func.__name__
return C(func) return C(func, *a, **kw)
def ParsedCommand(func): def ParsedCommand(func):
class C(_ParsedCommand): class C(_ParsedCommand):

@ -68,7 +68,7 @@ def register_shell_function(cmd):
os.execvp(cmd, (cmd,) + a) os.execvp(cmd, (cmd,) + a)
os.wait() os.wait()
handler.__name__ = cmd handler.__name__ = cmd
pwndbg.commands.Command(handler) pwndbg.commands.Command(handler, False)
for cmd in shellcmds: for cmd in shellcmds:
register_shell_function(cmd) register_shell_function(cmd)

Loading…
Cancel
Save