import gdb

class pp(gdb.Command):
    """Python print its arg"""
    def __init__(self):
        gdb.Command.__init__ (self, "pp", gdb.COMMAND_DATA,
                              completer_class=gdb.COMPLETE_SYMBOL)

    def invoke (self, arg, from_tty):
        gdb.execute("python print %s" % arg)
pp()

class ppd(gdb.Command):
    """Python print dir() of its arg"""
    def __init__(self):
        gdb.Command.__init__ (self, "ppd", gdb.COMMAND_DATA, completer_class=gdb.COMPLETE_SYMBOL)

    def invoke (self, arg, from_tty):
        gdb.execute("python print dir(%s)" % arg)
ppd()
