Eclipse条件断点。如何检查异常是否发生? [英] Eclipse Conditional-Breakpoint. How to check if exception occurs?
问题描述
我有这个功能:
public static FradId readFradId(DataInput pIn) throws IOException {
Integer lMainId = Integer.valueOf(pIn.readInt());
Integer lReferenceId = Integer.valueOf(pIn.readInt());
String lShortname = pIn.readUTF();
return new FradId(lMainId,lReferenceId,lShortname);
}
我在这一行找到一个断点:
I got a breakpoint at this line:
String lShortname = pIn.readUTF();
我的问题在某些情况下是 readUTF
抛出一个 RuntimeException
。应用程序执行的功能超过100次,所以我很难找到问题。
my problem is in some cases the function readUTF
throws a RuntimeException
. The application executes the function more than 100 times so it is very difficult for me finding the problem.
我的问题:有一种方法来捕获这个异常与断点条件?我已经使用这种条件,容易的布尔条件,但我不知道如何在抛出异常时停止该行。
my question: is there a way to catch that exception with a breakpoint condition? I already use that conditions with easy boolean conditions, but I dont know how to stop in that line when a exception is thrown.
提前提前
Stefan
推荐答案
是否有一个名为异常断点的选项
打开断点视图,点击 j!
选项并添加所需的异常
Yes there is a option called "exception breakpoint"
Open Breakpoint view, click on j!
option and add desired exception
这篇关于Eclipse条件断点。如何检查异常是否发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!