This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187736 - Do not disable breakpoint requests during method invocation
Summary: Do not disable breakpoint requests during method invocation
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 187533
  Show dependency tree
 
Reported: 2010-06-17 14:32 UTC by Martin Entlicher
Modified: 2010-07-16 07:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2010-06-17 14:32:39 UTC
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.
Comment 1 Martin Entlicher 2010-06-17 15:30:27 UTC
Changing that will also affect the fix of issue #65897.
Comment 2 Martin Entlicher 2010-06-17 15:43:39 UTC
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.
Comment 3 Martin Entlicher 2010-06-18 15:13:07 UTC
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
   breakpoint.
   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
             breakpoint event.

All three use-cases should be verified.

Fixed changeset:   173232:679c764d624d
http://hg.netbeans.org/main/rev/679c764d624d
Comment 4 Quality Engineering 2010-06-19 03:38:25 UTC
Integrated into 'main-golden', will be available in build *201006190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/679c764d624d
User: mentlicher@netbeans.org
Log: #187736 We do not disable breakpoints when invoking a method, we remove the events instead and resume method invocation.
Comment 5 Martin Entlicher 2010-06-21 14:37:28 UTC
Also it'll be good to verify the fix with project running on JDK 1.5.
Comment 6 rbalada 2010-06-21 16:01:17 UTC
Please verify bugfix for this bug, so it can be integrated into release691 repository.

Thanks,
-R
Comment 7 Marian Mirilovic 2010-06-22 10:47:22 UTC
verified in 201006220001
Comment 8 rbalada 2010-06-22 13:38:44 UTC
main #679c764d624d transplanted to release691 #87cf10e83df7
Comment 9 Marian Mirilovic 2010-07-16 07:44:55 UTC
verified in NetBeans IDE 6.9.1 Dev (Build 201007152301)