コード例 #1
0
ファイル: debugger.py プロジェクト: bbarker/fred
    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)
コード例 #2
0
ファイル: debugger.py プロジェクト: karya0/fred
 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()
コード例 #3
0
ファイル: debugger.py プロジェクト: bbarker/fred
    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()
コード例 #4
0
ファイル: freddebugger.py プロジェクト: karya0/fred
 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)
コード例 #5
0
    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)
コード例 #6
0
ファイル: debugger.py プロジェクト: karya0/fred
 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)