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 44582 - Multithred debugging - Step ... Action + Breakpoint confilct
Summary: Multithred debugging - Step ... Action + Breakpoint confilct
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: UI, USABILITY
: 81226 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-08 18:21 UTC by zikmund
Modified: 2010-04-29 09:17 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2004-06-08 18:21:29 UTC
Build 200406080606

I have driven to serious problems when debugging a
multithread application. When I reached a
breakpoint, I did Step Over, the debugger reached
other breakpoint int different thread sooner.
I caused that:
1) I was confused what the "hell source" I have
reached.
2) There was no way how to finish previous Step
Over -- all the debugging work was lost.

BTW: It is not very rare -- good example is in the
WebApps when debugging a filter for a frame-based
HTML files. Web server get the request which are
solved in separate threads. The only way how to
debug that filter was synchronizing.

Solution:
add 1)
Give the user an information that debugged thread
was changed -- it could be at least a status bar
message. Provide this solution on all actions when
you expect reaching some source: Step Over, Step
Into, Step Out, Run to Cursor. It is not necessary
to do it on Continue action.

add 2)
When different thread is reached, give the user a
chance to "Set" a breakpoint to the previous
target (if possible).

Notice: Some solutions could appear like an
enhancement, but I think that some easy
preliminary solution could be provided as a fix.
Comment 1 Jan Jancura 2004-06-09 09:13:16 UTC
Thank for your valuable report. I am not sure if we will be able to
fix it for nb40 (ui changes required).
Comment 2 Paul Byrne 2004-11-09 17:33:31 UTC
This bug makes the debugger unusable when working with projects such
as Java3D and Project Looking Glass, and I have not discovered a
workaround so I've raised it to P2.

How about an implementation change in which if a breakpoint is hit in
another thread during a single step then that thread is put to sleep.
Informing the user of this would be desirable but could wait until 4.1.
This change would at least mean that we could debug threaded
applications in NB.
Comment 3 Jan Jancura 2004-11-10 10:50:57 UTC
Too risky to do it now. We plan to implement it for nb4.1.
Comment 4 Roman Ondruska 2005-05-11 11:04:09 UTC
See also issues #40901, #17855
Comment 5 Martin Entlicher 2006-08-14 16:56:10 UTC
*** Issue 81226 has been marked as a duplicate of this issue. ***
Comment 6 Martin Entlicher 2006-08-14 17:00:00 UTC
Please note that if you use "Continue" action after the breakpoint in another
thread was hit, the step will be finished then and you'll get back to the
original context.

Freezing of threads is actually one possible solution, but we have to have some
deadlock-detection mechanism. The thread in which you're stepping can be easily
blocked by waiting to acquire some monitor that is held by another thread.
Comment 7 Martin Entlicher 2007-03-16 16:10:02 UTC
Fixed in trunk. We provide a dialog notifying that a step is interrupted by
breakpoint. The user can decide whether the breakpoint or the step is in their
interest.

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDAStepImpl.java,v
 <--  JPDAStepImpl.java
new revision: 1.8; previous revision: 1.7

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v
 <--  JPDADebuggerImpl.java
new revision: 1.116; previous revision: 1.115

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.74; previous revision: 1.73

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/BreakpointImpl.java,v
 <--  BreakpointImpl.java
new revision: 1.35; previous revision: 1.34

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.9; previous revision: 1.8

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/actions/StepActionProvider.java,v
 <--  StepActionProvider.java
new revision: 1.37; previous revision: 1.36
Comment 8 Martin Entlicher 2007-06-08 16:09:31 UTC
In 6.0M10 is the modal informational dialog changed to non-modal and less
intrusive solution - an informational panel in Threads View:

/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.609; previous revision: 1.608

/cvs/debuggerjpda/nbproject/project.xml,v  <--  project.xml
new revision: 1.21; previous revision: 1.20

/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/BreakpointImpl.java,v
 <--  BreakpointImpl.java
new revision: 1.41; previous revision: 1.40

/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.13; previous revision: 1.12

RCS file:
/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/ThreadInfoPanel.form,v

/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/ThreadInfoPanel.form,v
 <--  ThreadInfoPanel.form
initial revision: 1.1

RCS file:
/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/ThreadInfoPanel.java,v

/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/ThreadInfoPanel.java,v
 <--  ThreadInfoPanel.java
initial revision: 1.1

RCS file:
/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/information_16.png,v

/cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/information_16.png,v
 <--  information_16.png
initial revision: 1.1
Comment 9 Quality Engineering 2010-04-29 09:17:58 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.