CDT Breakpoint management
Eclipse provides a IBreakpointManager to maintain all the breakpoints. You can get the IBreakpointManager by DebugPlugin.getDefault.getBreakpointManager().
Each debug architecture: Java or CDT, they provide their own IBreakpointManager, which registered as IBreakointsListener. For CDT, the CBreakpoingManager registers itself as a IBreakpointsListener, and whenever user inserts a new breakpoint, the Eclipse BreakpointManager will create and add a new breakpoint to its breakpoint list, and then notify the listeners:
When CBreakpointManagers insert a breakpoint, they always make it deferrable, since they are not sure whether the breakpoint is either for the running binary or for the unloaded DLL. When GDB fails to insert breakpoint, the breakpoints will be put into deferred breakpoint list. These deferred breakpoint list is supposed to be set over unloaded DLL. Later, when a new DLL is loaded, then the GDB will try to insert the breakpoint from the deferred breakpoint list.
The BreakpointsView will show different markers for different type of breakpoints. For breakpoints in the breakMap (which is already patched to the binary), BreakpointsView shows them as activated. For breakpoints in the deferredMap (which is not patched until the DLL is loaded), BreakpointsView shows them as deactivated.
The following is a call sequence:

User::ToggleBreakpointRulerAction.getAdapter(IToggleBreakpointsTarget)
ToggleBreakpointAdapter::CDIDebugModel.createLineBreakpoint()
CLineBreakPoint::BreakpointManager.addBreakpoint()
(Eclipse)BreakpointManager::BreakpointNotifier.notify(IBreakpointsListener)- sequential
CBreakpointManager::Target.setLinebreakpoint() { - parallel
(CDT)BreakpointManager.setNewLocationBreakpoint{
suspendInferior();
insertBreakpoint();
resumeInferior();
}
}


0 Comments:
Post a Comment
<< Home