code: def Attach(self, pid):
      
      if self.inferior.is_running:
        answer = raw_input('Already attached to process ' +
                           str(self.inferior.pid) +
                           '. Detach? [y]/n ')
        if answer and answer != 'y' and answer != 'yes':
          return None
        self.Detach()
      # Whatever position we had before will not make any sense now
      for plugin in self.plugins:
        plugin.position = None
      self.inferior.Reinit(pid)
docs: Attach to the process with the given pid.