'Save/restore process\'s snapshot to/from file
Usage:
MYNAME save file
MYNAME restore file
Warning: this is not thread safe, do not use with multithread program'

def snapshot(self, *arg):

    options = ['save', 'restore']
    (opt, filename) = normalize_argv(arg, 2)
    if (opt not in options):
        self._missing_argument()
    if (not filename):
        filename = peda.get_config_filename('snapshot')
    if (opt == 'save'):
        if peda.save_snapshot(filename):
            msg(("Saved    process's    snapshot    to    filename    '%s'" % filename))
        else:
            msg("Failed    to    save    process's    snapshot")
    if (opt == 'restore'):
        if peda.restore_snapshot(filename):
            msg(("Restored    process's    snapshot    from    filename    '%s'" % filename))
            peda.execute('stop')
        else:
            msg("Failed    to    restore    process's    snapshot")
    return
