//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeBreakpointPending FindPendingBreakpoint(uint id) { LoggingUtils.PrintFunction(); try { DebuggeeBreakpointBound boundBreakpoint = FindBoundBreakpoint(id); if (boundBreakpoint != null) { LoggingUtils.RequireOk(boundBreakpoint.GetPendingBreakpoint(out IDebugPendingBreakpoint2 pendingBreakpoint)); return(pendingBreakpoint as DebuggeeBreakpointPending); } DebuggeeBreakpointError errorBreakpoint = FindErrorBreakpoint(id); if (errorBreakpoint != null) { LoggingUtils.RequireOk(errorBreakpoint.GetPendingBreakpoint(out IDebugPendingBreakpoint2 pendingBreakpoint)); return(pendingBreakpoint as DebuggeeBreakpointPending); } } catch (Exception e) { LoggingUtils.HandleException(e); } return(null); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeBreakpointBound FindBoundBreakpoint(uint id) { // // Search all registered pending breakpoints objects for a bound breakpoint matching the requested id. // LoggingUtils.PrintFunction(); try { foreach (DebuggeeBreakpointPending pending in m_pendingBreakpoints.ToArray()) { // // Check for matching 'bound' breakpoints. // uint numBoundBreakpoints; IEnumDebugBoundBreakpoints2 enumeratedBoundBreakpoints; LoggingUtils.RequireOk(pending.EnumBoundBreakpoints(out enumeratedBoundBreakpoints)); LoggingUtils.RequireOk(enumeratedBoundBreakpoints.GetCount(out numBoundBreakpoints)); if (numBoundBreakpoints > 0) { DebuggeeBreakpointBound [] boundBreakpoints = new DebuggeeBreakpointBound [numBoundBreakpoints]; LoggingUtils.RequireOk(enumeratedBoundBreakpoints.Next(numBoundBreakpoints, boundBreakpoints, numBoundBreakpoints)); for (uint i = 0; i < numBoundBreakpoints; ++i) { if (boundBreakpoints [i] is CLangDebuggeeBreakpointBound) { CLangDebuggeeBreakpointBound bound = boundBreakpoints [i] as CLangDebuggeeBreakpointBound; if (bound.GdbBreakpoint.ID == id) { return(bound); } } else { throw new NotImplementedException("Unrecognised bound breakpoint type"); } } } } } catch (Exception e) { LoggingUtils.HandleException(e); } return(null); }