本文介绍了为什么intellij想法不会立即终止调试过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 idea 2016.1.1 ,并想知道为什么当我点击停止按钮时想法不会立即终止调试过程。

I'm using idea 2016.1.1 and wonder why idea does not kill the debug process immediately when I click the stop button.

例如。使用这段代码重现它

E.g. use this piece of code to reproduce it

public class Main {

  public static void main(String[] args) {
    int i = 0;
    while (true) {
      i++;
      System.out.print("I'm still alive: ");
      System.out.println(i);
    }
  }
}

在循环之前设置断点开始。

Set a breakpoint before the loop begins.

启动调试会话,等到它会断开并按下红色停止按钮(CTRL-F2)。

Start a debugging session, wait until it breaks and press the red stop button (CTRL-F2).

我希望这个过程立即停止并且它不会打印任何内容,但会打印出来:

I would expect that the process is stopped immediately and that it does not print anything, but it prints:

"C:\Program Files\Java\jdk1.6.0_38\bin\java" ....
Connected to the target VM, address: '127.0.0.1:54394', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:54394', transport: 'socket'
I'm still alive: 1
I'm still alive: 2
I'm still alive: 3
I'm still alive: 4
...
I'm still alive: 319
I'm still alive: 320
I'm still alive: 321
I'm still alive: 
Process finished with exit code -1

为什么流程没有立即停止?

是否有其他方法可以立即停止?

编辑

刚刚尝试了 idea 14.1.5 。该过程会按预期立即停止。似乎2016年引入了一个错误。

Just tried it with idea 14.1.5. The process stops immediately as expected. It seems that a bug was introduced with 2016.

推荐答案

错误在 2016.3(163.7743.44)中修复。我刚刚验证了它。

The bug IDEA-155007 is fixed in 2016.3 (163.7743.44). I've just verified it.

这篇关于为什么intellij想法不会立即终止调试过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 20:48