Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344635 - [breakpoints] Installed decorator no longer appears after an inferior runs to completion
Summary: [breakpoints] Installed decorator no longer appears after an inferior runs to...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 15:31 EDT by Marc Khouzam CLA
Modified: 2011-05-03 21:23 EDT (History)
2 users (show)

See Also:
marc.khouzam: review? (fchouinard)


Attachments
Fix (2.21 KB, patch)
2011-05-03 20:34 EDT, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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