Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse SWING app: breakpoint hit only after an uncaught exception is thrown

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?

like image 431
AndreaC Avatar asked Jun 22 '09 12:06

AndreaC


1 Answers

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)

like image 192
VonC Avatar answered Oct 01 '22 12:10

VonC