def do_restart(self, n_index=-1, b_clear_history=False): """Restart from the current or specified checkpoint. n_index defaults to -1, which means restart from current checkpoint.""" global gn_time_restarting, gn_total_restarts fredutil.fred_timer_start("restart") self.branch.do_restart(n_index, b_clear_history, self.reset_on_restart) gn_time_restarting += fredutil.fred_timer_stop("restart") gn_total_restarts += 1 # XXX Figure out a way to do this without fredio. import fredio self.set_real_debugger_pid(fredio.get_child_pid()) del fredio self.update_state() # Reset real inferior pid, as it gets a new real pid on restart. fredmanager.reset_real_inferior_pid(self.get_real_debugger_pid())
def do_restart(self, n_index=-1, b_clear_history=False): """Restart from the current or specified checkpoint. n_index defaults to -1, which means restart from current checkpoint.""" global gn_time_restarting, gn_total_restarts fredutil.fred_timer_start("restart") self.branch.do_restart(n_index, b_clear_history, self.reset_on_restart) gn_time_restarting += fredutil.fred_timer_stop("restart") gn_total_restarts += 1 # XXX Figure out a way to do this without fredio. import fredio self.set_real_debugger_pid(fredio.get_child_pid()) del fredio self.update_state() if self.personality_name() == "gdb": # Reset real inferior pid, as it gets a new real pid on restart. fredmanager.reset_real_inferior_pid(self.get_real_debugger_pid())
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)