Bug 140558 - [breakpoints] Breakpoint not hit
Summary: [breakpoints] Breakpoint not hit
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 140478 142473 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-08 09:24 EDT by Darin Wright CLA
Modified: 2006-08-29 09:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2006-05-08 09:24:47 EDT
From bug 140478:

"First, sometimes I place a breakpoint and it is not being hit. I have a
println() statement that executes (I see the output), but when I set a
breakpoint at that line, nothing happens. Other breakpoints that I have set
earlier are being hit. Restarting the debug session solved it."
Comment 1 Darin Wright CLA 2006-05-08 09:29:08 EDT
Reported against 3.2RC3.

Do you have a test case for this? Had any hot code replace been performed on the target VM? Had any hot code replace operations failed?
Comment 2 Darin Wright CLA 2006-05-08 09:31:08 EDT
*** Bug 140478 has been marked as a duplicate of this bug. ***
Comment 3 Genady Beryozkin CLA 2006-05-08 10:25:23 EDT
It is reproducible, I'll try to build a small test case.
I use hot code replace a lot, but it hasn't failed (the println() statement was added with hot code replace, but the bug occurs even on fresh runs).
Comment 4 Darin Wright CLA 2006-06-19 11:55:10 EDT
*** Bug 142473 has been marked as a duplicate of this bug. ***
Comment 5 Darin Wright CLA 2006-07-25 14:57:44 EDT
Genady, have you been able to reproduce this in the 3.2.1 maintenance stream?
Comment 6 misja CLA 2006-07-25 15:32:00 EDT
I switched back to 3.1.2 hoping to avoid this bug, but the same bug occurs in 3.1.2. 
Although I feel it doesn't occur that often, but I can't prove it so maybe I'm wrong.

It seems that breakpoints are missed most often when I run JUnit testcases. So sometimes if I want to debug something I write a main() function and use that as a workaround.
Comment 7 Darin Wright CLA 2006-07-25 15:39:39 EDT
Thanks for reporting back - I have still not seen this. When it happens next time - ensure you are in debug mode, and ensure that the "skip breakpoints" toggle (in the breakpoints view) is not "on". Also ensure that your breakpoints appear as "installed" (i.e. with a check mark besdie them).
Comment 8 Genady Beryozkin CLA 2006-07-28 12:40:47 EDT
I haven't seen it recently (still using 3.2). I'll update to 3.2.1 next week and check all these bugs.
Comment 9 misja CLA 2006-08-08 06:51:08 EDT
I have experienced the problem a couple of times again, and have checked thoroughly that:
- the breakpoint is installed/enabled in the breakpoints view;
- I have not been doing hot code replace;
- there was not another instance of my testcase running at the same time

As I mentioned earlier, a workaround that succeeds 100% of the times is not to debug my testcase using JUnit, but writing a main() function just for debug purposes.

I'm just thinking what the cause of this problem might be; my JUnit testcases depend on a couple of projects; all of them depend on (their own) junit jars. Could that perhaps be part of the problem? I tried to remove all redundant junit jars from the classpath but it didn't help. But maybe I forgot some reference somewhere?
Still it is strange that the same breakpoint is sometimes hit and sometimes missed.
Comment 10 Darin Wright CLA 2006-08-09 14:51:29 EDT
There may be an issue if you place a breakpoint in a class for which there are several instances on the runtime classpath. I.e. the source that you place the breakpoint in may not match the class file loaded at runtime, depending on your classpath order. So, the breakpoint appears loaded/installed, but does not get hit because line numbers do match up as you think they should.

Strange that using a main() vs JUnit makes the problem go away. I have no explanataion for this, and have not experience the problem yet.
Comment 11 Darin Wright CLA 2006-08-29 09:38:13 EDT
Based on comment#9 in bug bug 142473, and comment #8 in this bug, marking as works for me.