'Restore a saved snapshot of current process
Warning: this is not thread safe, do not use with multithread program
Returns:
- Bool'

def give_snapshot(self, snapshot):

    if ((not snapshot) or (not self.getpid())):
        return False
    for (addr, buf) in snapshot['mem'].items():
        self.writemem(addr, buf)
    for (r, v) in snapshot['reg'].items():
        self.execute(('set    $%s    =    0x%x' % (r, v)))
        if r.endswith('sp'):
            sp = v
    self.execute(('set    $sp    =    0x%x' % sp))
    return True
