Eclipse SWING应用程序:只有在抛出未捕获的异常之后,才会触发断点 [英] Eclipse SWING app: breakpoint hit only after an uncaught exception is thrown
问题描述
我正在Eclipse中使用Java SWING应用程序。我在我的代码中设置了一个断点,然后运行调试。我执行包含断点的代码段,但总是被跳过。
一旦我运行一些引发未捕获的异常的代码,断点就会再次被击中,而不会改变任何东西。抛出异常的代码和包含断点的代码不相关。
我尝试在多个地方设置断点,但是直到异常被抛出为止。
我只有这个特定的应用程序有这个问题。我的调试器适用于其他SWING应用程序。
你能想到导致这种情况的原因吗?
您正在运行什么精确版本的eclipse和Java?
您是否知道这个问题? (错误279137 :断点无法击中JDK 1.6.0_14)
作为 gojomo 评论中的那个bug(279137)现在(2009年7月21日)提到:
这个bug现在在太阳bug中可见数据库: bug 6862295 。
我们列出了这个问题的解决方法,可以在我们调查该错误的修复程序时使用。
工作环境
使用选项
-XX:+ UseParallelGC
使客户端虚拟机或服务器虚拟机无法重现故障。
(可选择添加到 eclipse.ini )
我会建议你使用'看这个bug'功能,所以当有bug的更新时你可以收到通知。以下是观看此 具体错误的链接
FIXED
作为jdk6_u16的 发行说明 (2009年8月下旬)提到,该错误已被修复
此版本中修复的错误:
6862295 在调试会话期间JDWP线程更改(导致忽略断点)
I have a really strange issue. I am working on a Java SWING application in Eclipse. I set a breakpoint somewhere in my code, then run the debug. I execute the piece of code containing the breakpoint but it is always skipped. As soon as I run some code that throws an uncaught exception, the breakpoints start being hit again, without changing anything else. The code that throws the exception and the one containing the breakpoint are not related.
I tried to set the breakpoints in several places but they never get hit until the exception is thrown. I have this problem only for this one specific application. My debugger works fine for other SWING apps.
Can you think of any reason causing this?
What exact version of eclipse and Java are you running?
Are you aware of this question? (bug 279137: Breakpoints fail to hit under JDK 1.6.0_14 )
As gojomo remarks in the comments, that bug (279137) now (July 21 2009) mentions:
The bug is now visible in the sun bug database: bug 6862295.
We have listed a workaround for this problem, which can be used while we investigate a fix for the bug.
Work Around
Using the option
-XX:+UseParallelGC
makes the failure not reproducible with either the Client VM or the Server VM.
(Option yo add to the eclipse.ini)
I would recommend that you use the 'watch this bug' feature, so you can be notified when there are updates to the bug. Here is the link to watch this specific bug
FIXED
As the release note of the jdk6_u16 (late August 2009) mentions, that bug has been fixed
Bug fixed in this release:
6862295 JDWP threadid changes during debugging session (leading to ignored breakpoints)
这篇关于Eclipse SWING应用程序:只有在抛出未捕获的异常之后,才会触发断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!