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

Bug 344635

Summary: [breakpoints] Installed decorator no longer appears after an inferior runs to completion
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 8.0Flags: marc.khouzam: review? (fchouinard)
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Fix marc.khouzam: iplog-

Description Marc Khouzam CLA 2011-05-03 15:31:02 EDT
With GDB >= 7.2 if I run an inferior to completion and then re-launch, the install decorator no longer appears on an existing breakpoint.

1- launch an application with GDB >= 7.2
2- set a breakpoint and see the installation decorator on the bp
3- resume until the inferior completes
4- re-launch the same application and see that the bp does not get the installation decorator even though it is installed in GDB.

My guess is that I broke this when fixing Bug 336890
Comment 1 Marc Khouzam CLA 2011-05-03 15:55:18 EDT
The preference to terminate GDB once the last inferior terminates has to be selected to see the problem.

It seems we do a double un-install, one when the inferior terminates and one when gdb terminates.
Comment 2 Marc Khouzam CLA 2011-05-03 20:34:20 EDT
Created attachment 194660 [details]
Fix

There was a race condition in the MIBreakpointsManager when uninstalling breakpoints and gdb terminating which also cleared the installed decorator.  Before the fix for Bug 336890, we would not uninstall breakpoints when the process terminated, so the only time the decorator would be cleared was when gdb terminated.

Now that we uninstall breakpoints when a process terminates for GDB >= 7.2, it brought out this race condition where the uninstall and the gdb terminate would both decrement the install count.  The install count would end up at -1 and would not be shown anymore.

This patch removes the breakpoint from the map, right away, so that a gdb terminate will not try to clear it again.

Committed to HEAD
Comment 3 Marc Khouzam CLA 2011-05-03 20:35:41 EDT
Francois, can you review?
Comment 4 CDT Genie CLA 2011-05-03 21:23:02 EDT
*** cdt cvs genie on behalf of mkhouzam ***
Bug 344635: Installed decorator no longer appears after an inferior runs to completion

[*] MIBreakpointsManager.java 1.23 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java?root=Tools_Project&r1=1.22&r2=1.23