Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311236

Summary: [breakpoints] breakpoint view not updated on delete when 'group by' and 'show supported' options are enabled
Product: [Eclipse Project] Platform Reporter: Jeremiah Swan <swanj>
Component: DebugAssignee: Pawel Piech <pawel.1.piech>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: darin.eclipse, pawel.1.piech
Version: 3.6Flags: darin.eclipse: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JDT patch to provoke error condition
none
some tracing to accompany the recreation steps
none
Fix.
none
Complete fix patch. none

Description Jeremiah Swan CLA 2010-04-30 15:44:53 EDT
Build Identifier: I20100425-2000

The breakpoint view does not refresh itself to remove a breakpoint when two simultaneous debug sessions support different breakpoints (of the same type) and the 'group by > breakpoint types' and 'show breakpoints supported by selected target' are both enabled.

Reproducible: Always

Steps to Reproduce:
1. Apply the attached patch to JDT (the patch makes it so that watchpoints on field "aaa" are only 'supported by' launch configs named "AAA", and watchpoints on field "bbb" are only 'supported by' launch configs named "BBB")
2. Create a helloWorld app which contains integer fields "aaa" and "bbb"
3. Remove all breakpoints
4. Enable 'show breakpoints supported by selected target'
5. Enable 'group by > breakpoint types'
6. Create and launch a config named "AAA" for the app
7. Create and launch a config named "BBB" for the app
8. Create watchpoints for fields "aaa" and "bbb"
9. Select the AAA target.  Verify watchpoint "aaa" is visible in the BP view
10. Select the BBB target.  Verify watchpoint "bbb" is visible in the BP view
11. Delete watchpoint "bbb".  Note that the watchpoint is still visible in the view.  If you run either of the applications you can verify that the watchpoint was uninstalled (it is not hit), but it will remain in the view until you force a refresh by enabling 'group by > breakpoints'
Comment 1 Jeremiah Swan CLA 2010-04-30 15:46:05 EDT
Created attachment 166670 [details]
JDT patch to provoke error condition
Comment 2 Jeremiah Swan CLA 2010-04-30 15:46:42 EDT
Created attachment 166671 [details]
some tracing to accompany the recreation steps
Comment 3 Pawel Piech CLA 2010-04-30 17:51:33 EDT
Created attachment 166695 [details]
Fix.

What happens is that by the time IBreakpointsListener.breakpointRemoved() is called, the breakpoint marker is gone (sometimes), so the "bbb".equals(bp.getFieldName()) test fails and the breakpoint doesn't get removed.  

The good news is that this bug should not surface under normal circumstances because debuggers don't typically check the marker attributes to determine whether to filter a breakpoint, but it's still a real bug.  This fix gets rid of the filtering of the removed breakpoints, and just checks whether the breakpoint was actually removed from the container (if a breakpoint was previously filtered it will not be removed).
Comment 4 Pawel Piech CLA 2010-04-30 17:53:05 EDT
Marking as minor since it shouldn't affect real world use cases.  Thank you Jeremiah.
Comment 5 Pawel Piech CLA 2010-04-30 17:54:44 EDT
Created attachment 166696 [details]
Complete fix patch.
Comment 6 Pawel Piech CLA 2010-05-03 12:59:46 EDT
Darin, would you like me to commit this fix?  I believe I need you to approve it before committing.
Comment 7 Darin Wright CLA 2010-05-03 15:56:29 EDT
Approved, please commit.
Comment 8 Pawel Piech CLA 2010-05-03 16:39:47 EDT
Fixed with patch committed for bug 311384.
Comment 9 Pawel Piech CLA 2010-05-03 16:40:07 EDT
Already reviewed.