def interrupt_inferior(self): """Sends a ^C to the inferior process.""" fredutil.fred_assert(self.personality_name() == 'gdb', "Unimplemented") n_pid = fredmanager.get_real_inferior_pid() if n_pid != -1: os.kill(n_pid, signal.SIGINT)
def stop_inferior(self): """Sends SIGSTOP to inferior process.""" n_pid = fredmanager.get_real_inferior_pid() fredutil.fred_assert(n_pid != -1) os.kill(n_pid, signal.SIGSTOP) # XXX: Figure out a way to avoid using fredio. import fredio fredio.wait_for_prompt() del fredio self.disable_sigstop()
def stop_inferior(self): """Sends SIGSTOP to inferior process.""" fredutil.fred_assert(self.personality_name() == 'gdb', "Unimplemented") n_pid = fredmanager.get_real_inferior_pid() fredutil.fred_assert(n_pid != -1) os.kill(n_pid, signal.SIGSTOP) # XXX: Figure out a way to avoid using fredio. import fredio fredio.wait_for_prompt() del fredio self.disable_sigstop()
def log_command(self, s_command): """Convert given command to FredCommand instance and add to current history.""" # XXX: Figure out a more elegant way to do this. We can't set the # inferior pids until we know the inferior is alive, so we keep trying # to update them with every command issued until it succeeds. if fredmanager.get_real_inferior_pid() == -1: fredmanager.reset_real_inferior_pid(self.get_real_debugger_pid()) if fredmanager.get_virtual_inferior_pid() == -1: s_virt_pid = self.evaluate_expression("getpid()") if s_virt_pid != GS_NO_SYMBOL_ERROR: fredmanager.set_virtual_inferior_pid(int(s_virt_pid)) else: fredutil.fred_debug("Can't set virtual pid; no getpid() " + "symbol available.") if self.current_checkpoint() != None: # identify_command() sets native representation cmd = self._p.identify_command(s_command) self.current_checkpoint().log_command(cmd)
def log_command(self, s_command): """Convert given command to FredCommand instance and add to current history.""" if self.personality_name() == "gdb": # XXX: Figure out a more elegant way to do this. We can't set the # inferior pids until we know the inferior is alive, so we keep trying # to update them with every command issued until it succeeds. if fredmanager.get_real_inferior_pid() == -1: fredmanager.reset_real_inferior_pid( self.get_real_debugger_pid()) if fredmanager.get_virtual_inferior_pid() == -1: s_virt_pid = self.evaluate_expression("getpid()") if s_virt_pid != GS_NO_SYMBOL_ERROR: fredmanager.set_virtual_inferior_pid(int(s_virt_pid)) else: fredutil.fred_debug("Can't set virtual pid; no getpid() " + "symbol available.") if self.current_checkpoint() != None: # identify_command() sets native representation cmd = self._p.identify_command(s_command) self.current_checkpoint().log_command(cmd)
def interrupt_inferior(self): """Sends a ^C to the inferior process.""" n_pid = fredmanager.get_real_inferior_pid() if n_pid != -1: os.kill(n_pid, signal.SIGINT)