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

Bug 435144

Summary: [breakpoints] Cannot set breakpoints for GDB 7.0 or 7.1
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: major    
Priority: P3 CC: cdtdoug, m.kudimov, pawel.1.piech, peh
Version: 8.4.0   
Target Milestone: 8.7.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/44028
https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=9f27d7cc2062b11e021043497e43f60de926fdeb
Whiteboard:
Bug Depends on:    
Bug Blocks: 457843    

Description Marc Khouzam CLA 2014-05-17 21:40:19 EDT
Another side-effect of Bug 431986 is that breakpoints can no longer be set with GDB 7.0 and 7.1!

The reason is that the IBpTargetDMC does not contain the pid as we create it before starting the process, but the target filter does know the pid as we now create it based on the running process (we use to create the filter based on the IBpTargetDMC).  Because the two DMCs don't properly match, MIBreakpointsManager#isBreakpointEntirelyFiltered() returns true and the bp is uninstalled immediately.

For example:
IBpTargetDMC = gdb[0].proc[].threadGroup[]
IContainerDMC used for filter = gdb[0].proc[13344].threadGroup[13344]

This problem does not happen for GDB >= 7.2 because the threadGroup is no longer the pid for those GDBs but instead is the inferior (e.g., i1)
Comment 1 Marc Khouzam CLA 2015-03-20 13:45:40 EDT
I pushed a fix to gerrit:
https://git.eclipse.org/r/44028

The patch creates a new GDBBreakpointsManager_7_0 and GDBBreakpointsManager_7_2 to only affect GDB 7.0 and 7.1.

For those two versions, the problem was that the BreakpointsManager service would store the IBreakpointsTargetDMContext before the pid was allocated.  The patch listens for an IStartedDMEvent for the process, which will old the pid, and replaces every IBreakpointsTargetDMContext it holds with the new IBreakpointsTargetDMContext now containing the pid.

All changes in MIBreakpointsManager are to allow extending the class and naming some fields more clearly.
Comment 3 Marc Khouzam CLA 2015-03-27 11:47:42 EDT
Thanks Alvaro for the review.