Beispiel #1
0
        // Determines whether this pending breakpoint can bind to a code location.
        int IDebugPendingBreakpoint2.CanBind(out IEnumDebugErrorBreakpoints2 ppErrorEnum)
        {
            ppErrorEnum = null;

            if (!CanBind())
            {
                // Called to determine if a pending breakpoint can be bound.
                // The breakpoint may not be bound for many reasons such as an invalid location, an invalid expression, etc...
                // The debugger will display information about why the breakpoint did not bind to the user.
                ppErrorEnum = new AD7ErrorBreakpointsEnum(new[] { this._BPError });
                return(Constants.S_FALSE);
            }

            return(Constants.S_OK);
        }
 // Enumerates all error breakpoints that resulted from this pending breakpoint.
 int IDebugPendingBreakpoint2.EnumErrorBreakpoints(enum_BP_ERROR_TYPE bpErrorType, out IEnumDebugErrorBreakpoints2 ppEnum)
 {
     // Called when a pending breakpoint could not be bound. This may occur for many reasons such as an invalid location, an invalid expression, etc...
     // The sample engine does not support this, but a real world engine will want to send an instance of IDebugBreakpointErrorEvent2 to the
     // UI and return a valid enumeration of IDebugErrorBreakpoint2 from IDebugPendingBreakpoint2::EnumErrorBreakpoints. The debugger will then
     // display information about why the breakpoint did not bind to the user.
     if ((_BPError != null) && ((bpErrorType & enum_BP_ERROR_TYPE.BPET_TYPE_ERROR) != 0))
     {
         IDebugErrorBreakpoint2[] errlist = new IDebugErrorBreakpoint2[1];
         errlist[0] = _BPError;
         ppEnum     = new AD7ErrorBreakpointsEnum(errlist);
         return(Constants.S_OK);
     }
     else
     {
         ppEnum = null;
         return(Constants.S_FALSE);
     }
 }