Exemplo n.º 1
0
    def check_issue_command(self, command, **kwargs):
        cmd = DebuggerCommand(command, **kwargs)
        self._last_debugger_command = cmd

        if get_runner().is_waiting_debugger_command():
            logging.debug("_check_issue_debugger_command: %s", cmd)

            # tell MainCPythonBackend the state we are seeing
            cmd.setdefault(
                frame_id=self._last_progress_message.stack[-1].id,
                breakpoints=self.get_effective_breakpoints(command),
                state=self._last_progress_message.stack[-1].event,
                focus=self._last_progress_message.stack[-1].focus,
                allow_stepping_into_libraries=get_workbench().get_option(
                    "debugger.allow_stepping_into_libraries"),
            )
            if command == "run_to_cursor":
                # cursor position was added as another breakpoint
                cmd.name = "resume"

            get_runner().send_command(cmd)
            if command == "resume":
                self.clear_last_frame()
        else:
            logging.debug("Bad state for sending debugger command " +
                          str(command))
Exemplo n.º 2
0
 def _check_issue_debugger_command(self, command, **kwargs):
     cmd = DebuggerCommand(command=command, **kwargs)
     self._last_debugger_command = cmd
     
     if get_runner().get_state() == "waiting_debug_command":
         debug("_issue cmd: %s", cmd)
         
         # tell VM the state we are seeing
         cmd.setdefault (
             frame_id=self._last_progress_message.stack[-1].id,
             state=self._last_progress_message.stack[-1].last_event,
             focus=self._last_progress_message.stack[-1].last_event_focus
         )
         
         get_runner().send_command(cmd)
Exemplo n.º 3
0
    def _check_issue_debugger_command(self, command, **kwargs):
        cmd = DebuggerCommand(command=command, **kwargs)
        self._last_debugger_command = cmd

        state = get_runner().get_state()
        if (state == "waiting_debugger_command"
                or getattr(cmd, "automatic", False) and state == "running"):
            logging.debug("_check_issue_debugger_command: %s", cmd)

            # tell VM the state we are seeing
            cmd.setdefault(
                frame_id=self._last_progress_message.stack[-1].id,
                state=self._last_progress_message.stack[-1].last_event,
                focus=self._last_progress_message.stack[-1].last_event_focus)

            get_runner().send_command(cmd)
        else:
            logging.debug("Bad state for sending debugger command " +
                          str(command))
Exemplo n.º 4
0
    def check_issue_command(self, command, **kwargs):
        cmd = DebuggerCommand(command, **kwargs)
        self._last_debugger_command = cmd

        if get_runner().is_waiting_debugger_command():
            logging.debug("_check_issue_debugger_command: %s", cmd)

            # tell VM the state we are seeing
            cmd.setdefault(
                frame_id=self._last_progress_message.stack[-1].id,
                breakpoints=code.get_current_breakpoints(),
                cursor_position=self.get_run_to_cursor_breakpoint(),
            )

            cmd.setdefault(
                state=self._last_progress_message.stack[-1].event,
                focus=self._last_progress_message.stack[-1].focus,
            )

            get_runner().send_command(cmd)
        else:
            logging.debug("Bad state for sending debugger command " + str(command))
Exemplo n.º 5
0
    def check_issue_command(self, command, **kwargs):
        cmd = DebuggerCommand(command, **kwargs)
        self._last_debugger_command = cmd

        if get_runner().is_waiting_debugger_command():
            logging.debug("_check_issue_debugger_command: %s", cmd)

            # tell VM the state we are seeing
            cmd.setdefault(
                frame_id=self._last_progress_message.stack[-1].id,
                breakpoints=code.get_current_breakpoints(),
                cursor_position=self.get_run_to_cursor_breakpoint(),
                state=self._last_progress_message.stack[-1].event,
                focus=self._last_progress_message.stack[-1].focus,
                allow_stepping_into_libraries=get_workbench().get_option(
                    "debugger.allow_stepping_into_libraries"
                ),
            )
            get_runner().send_command(cmd)
            if command == "resume":
                self.clear_last_frame()
        else:
            logging.debug("Bad state for sending debugger command " + str(command))