Currently, before a method is invoked, we disable all breakpoint requests, so that we do not get an event during method invocation. As soon as method invocation finishes, we enable the breakpoint requests again.
This process has negative impact on performance, but more importantly, other threads can miss breakpoints that are disabled.
Also, JavaFX have problems with hitting breakpoints during method invocations. We should handle this case in a different way than disabling breakpoints.
Changing that will also affect the fix of issue #65897.
Also I've found that by disabling of breakpoints during method invocation, we could loose some ClassPrepare events. That could result in non-functioning breakpoints in such classes. We have to process ClassPrepare events even during method invocation.
Breakpoint requests are not being disabled on method invocation.
There are three use-cases possible:
1) When a thread is suspended, user invokes a method that contains a breakpoint.
Solution: When we receive a breakpoint event we call resume on the event set
and ignore the event.
2) While a method invocation is running, another thread hits a breakpoint with
suspend all policy.
Solution: Wait a while whether the method invocation happens to finish (the
breakpoint can be hit right after method invocation is done) and if
it does not, we resume just the method invocation thread.
3) Breakpoint condition contains a method invocation that hits another
Solution: Since we get the breakpoint event in the event handler thread, we
need to start another event handler thread to process the another
breakpoint event and resume the threads suspended by such
All three use-cases should be verified.
Fixed changeset: 173232:679c764d624d
Integrated into 'main-golden', will be available in build *201006190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #187736 We do not disable breakpoints when invoking a method, we remove the events instead and resume method invocation.
Also it'll be good to verify the fix with project running on JDK 1.5.
Please verify bugfix for this bug, so it can be integrated into release691 repository.
verified in 201006220001
main #679c764d624d transplanted to release691 #87cf10e83df7
verified in NetBeans IDE 6.9.1 Dev (Build 201007152301)