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

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

Loading…
Cancel
Save