Eclipse条件断点不起作用 [英] Eclipse conditional breakpoint doesn't work
问题描述
我遇到的问题是条件断点在我的电脑上不起作用。我使用以下代码:
I faced with issue that conditional break point doesn't work on my PC. I use following code:
package test;
public class Main {
public static class C1 {
public static C1 c = new C1();
public Boolean b = null;
private boolean isB() {
if (b == null) {
b = Boolean.TRUE;
}
return b; //USE BREAKPOINT HERE
}
}
public static void main(String[] args) throws Exception {
Thread[] threads = new Thread[100];
for (int i = 0; i < 100; i++) {
Thread t = new Thread(new Runnable() {
public void run() {
C1.c.isB();
}
});
threads[i] = t;
}
for (Thread t : threads) {
t.start();
}
}
}
条件断点设置为返回b;行并使用Boolean.TRUE.equals(b)条件。
我在没有任何插件的情况下重新安装Eclipse并尝试了不同版本的Java 8,但每次我得到相同的错误时,都会说条件断点遇到运行时异常。原因:java.lang.InternalError:获取了ReferenceType的MethodID即不是ReferenceType的成员发现检索堆栈帧。
The conditional breakpoint is set to "return b;" line and use "Boolean.TRUE.equals(b)" conditional. I reinstall Eclipse without any plugin and tried different versions of Java 8, but each time I get the same error, that says "Conditional breakpoint encountered runtime exception. Reason: java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occured retrieving stack frames."
我不使用任何JRebel,DCEVM或一些分析工具。
I don't use any JRebel, DCEVM or some profiling tools.
可能是什么原因?它可能是CPU相关问题吗?我使用的是英特尔6700K。 Windows 10 + JDK8u111 + Neon.1a版本(4.6.1)。也不适用于Eclipse Mars。
What can be the reason? Could it be CPU related issue? I use Intel 6700K. Windows 10 + JDK8u111 + Neon.1a Release (4.6.1). Also doesn't work with Eclipse Mars.
推荐答案
我在Eclipse Photon 2018上使用JDK 8和7(均为64位)进行了测试
I've tested this with JDK 8 and 7 (both 64 bit) on Eclipse Photon 2018
版本:Photon Release(4.8 .0)
构建ID:20180619-1200
Version: Photon Release (4.8.0) Build id: 20180619-1200
并且断点工作正常。
我怀疑这取决于您的JDK或Eclipse版本。
I suspect this is down to your JDK or Eclipse version.
这篇关于Eclipse条件断点不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!