idea停止调试_为什么intellij想法不会立即终止调试过程?

bd96500e110b49cbb3cd949968f18be7.png

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.

54160f2662047e3bbb6f69210515a413.png

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

8d9tD.png

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

Why is the process not stopped immediately?

Is there another way to force an immediately stop?

EDIT

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

解决方案

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值