'Save/restore a working gdb session to file as a script
Usage:
MYNAME save [filename]
MYNAME restore [filename]'

def session(self, *arg):

    options = ['save', 'restore', 'autosave']
    (option, filename) = normalize_argv(arg, 2)
    if (option not in options):
        self._missing_argument()
    if (not filename):
        filename = peda.get_config_filename('session')
    if (option == 'save'):
        if peda.save_session(filename):
            msg(('Saved    GDB    session    to    file    %s' % filename))
        else:
            msg('Failed    to    save    GDB    session')
    if (option == 'restore'):
        if peda.restore_session(filename):
            msg(('Restored    GDB    session    from    file    %s' % filename))
        else:
            msg('Failed    to    restore    GDB    session')
    if (option == 'autosave'):
        if (config.Option.get('autosave') == 'on'):
            peda.save_session(filename)
    return
