コード例 #1
0
    private void processResponse(final String line) {
      try {
        final ProtocolFrame frame = new ProtocolFrame(line);
        logFrame(frame, false);

        if (AbstractThreadCommand.isThreadCommand(frame.getCommand())) {
          processThreadEvent(frame);
        } else if (AbstractCommand.isWriteToConsole(frame.getCommand())) {
          writeToConsole(ProtocolParser.parseIo(frame.getPayload()));
        } else if (AbstractCommand.isExitEvent(frame.getCommand())) {
          fireCommunicationError();
        } else if (AbstractCommand.isCallSignatureTrace(frame.getCommand())) {
          recordCallSignature(ProtocolParser.parseCallSignature(frame.getPayload()));
        } else {
          placeResponse(frame.getSequence(), frame);
        }
      } catch (Throwable t) {
        // shouldn't interrupt reader thread
        LOG.error(t);
      }
    }
コード例 #2
0
  @Override
  public void execute(@NotNull final AbstractCommand command) {
    if (command instanceof ResumeOrStepCommand) {
      final String threadId = ((ResumeOrStepCommand) command).getThreadId();
      clearTempVariables(threadId);
    }

    try {
      command.execute();
    } catch (PyDebuggerException e) {
      LOG.error(e);
    }
  }