コード例 #1
0
        int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo) {
            if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0) { }
            if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0) { }
            if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_THREAD) != 0) { }
            if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0) { }
            if (((uint)dwFields & (uint)enum_BPERESI_FIELDS.BPERESI_TYPE) != 0) { }

            throw new Exception("The method or operation is not implemented.");
        }
コード例 #2
0
        public int GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo) {
            var result = new BP_ERROR_RESOLUTION_INFO();
            result.dwFields = enum_BPERESI_FIELDS.BPERESI_MESSAGE | enum_BPERESI_FIELDS.BPERESI_TYPE;
            result.dwType = enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR;
            result.bstrMessage = Message;

            pErrorResolutionInfo[0] = result;
            return VSConstants.S_OK;
        }
コード例 #3
0
        public int GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo)
        {
            var result = new BP_ERROR_RESOLUTION_INFO();

            result.dwFields    = enum_BPERESI_FIELDS.BPERESI_MESSAGE | enum_BPERESI_FIELDS.BPERESI_TYPE;
            result.dwType      = enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR;
            result.bstrMessage = Message;

            pErrorResolutionInfo[0] = result;
            return(VSConstants.S_OK);
        }
コード例 #4
0
        public void GetResolutionInfo()
        {
            var fields = enum_BPERESI_FIELDS.BPERESI_ALLFIELDS;
            var errorResolutionInfo = new BP_ERROR_RESOLUTION_INFO[1];

            Assert.AreEqual(VSConstants.S_OK, breakpointError.GetResolutionInfo(fields,
                                                                                errorResolutionInfo));
            Assert.AreEqual(enum_BPERESI_FIELDS.BPERESI_MESSAGE | enum_BPERESI_FIELDS.BPERESI_TYPE,
                            errorResolutionInfo[0].dwFields);
            Assert.AreEqual(errorType, errorResolutionInfo[0].dwType);
            Assert.AreEqual(errorMessage, errorResolutionInfo[0].bstrMessage);
        }
コード例 #5
0
        string GetBreakpointErrorMessage(IDebugErrorBreakpoint2 breakpointError)
        {
            IDebugErrorBreakpointResolution2 errorBreakpointResolution;

            Assert.NotNull(breakpointError);
            Assert.AreEqual(VSConstants.S_OK,
                            breakpointError.GetBreakpointResolution(out errorBreakpointResolution),
                            "Unable to verify breakpoint error message. Failed to get breakpoint error " +
                            "resolution.");
            BP_ERROR_RESOLUTION_INFO[] errorResolutionInfo = new BP_ERROR_RESOLUTION_INFO[1];
            Assert.AreEqual(VSConstants.S_OK,
                            errorBreakpointResolution.GetResolutionInfo(enum_BPERESI_FIELDS.BPERESI_MESSAGE,
                                                                        errorResolutionInfo),
                            "Unable to verify breakpoint error message. Failed to get breakpoint error " +
                            "resolution info.");
            return(errorResolutionInfo[0].bstrMessage);
        }
 int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo)
 {
   Debug.WriteLine("AD7DebugErrorBreakpointResolution: GetResolutionInfo");
   if ( (dwFields == enum_BPERESI_FIELDS.BPERESI_ALLFIELDS) ||
     (( dwFields & enum_BPERESI_FIELDS.BPERESI_TYPE ) != 0 ) ||
     (( dwFields & enum_BPERESI_FIELDS.BPERESI_MESSAGE ) != 0 ) )
   {
     BP_RESOLUTION_INFO[] resolutionInfo = new BP_RESOLUTION_INFO[1];
     ((IDebugBreakpointResolution2)bp).GetResolutionInfo( enum_BPRESI_FIELDS.BPRESI_ALLFIELDS, resolutionInfo);
     pErrorResolutionInfo[0].dwFields = dwFields;
     pErrorResolutionInfo[0].bpResLocation = resolutionInfo[0].bpResLocation;
     pErrorResolutionInfo[0].pProgram = resolutionInfo[0].pProgram;
     pErrorResolutionInfo[0].pThread = resolutionInfo[0].pThread;
     pErrorResolutionInfo[0].dwType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING;
     pErrorResolutionInfo[0].bstrMessage = "Breakpoint invalid in this location.";
   }
   return VSConstants.S_OK;
 }
コード例 #7
0
        void HandleErrorEvent(IDebugBreakpointErrorEvent2 evnt)
        {
            IDebugErrorBreakpoint2 errorBreakpoint;

            HResultChecker.Check(evnt.GetErrorBreakpoint(out errorBreakpoint));
            IDebugErrorBreakpointResolution2 errorBreakpointResolution;

            HResultChecker.Check(
                errorBreakpoint.GetBreakpointResolution(out errorBreakpointResolution));
            var errorResolutionInfo = new BP_ERROR_RESOLUTION_INFO[1];

            HResultChecker.Check(errorBreakpointResolution.GetResolutionInfo(
                                     enum_BPERESI_FIELDS.BPERESI_MESSAGE, errorResolutionInfo));
            IDebugPendingBreakpoint2 pendingBreakpoint;

            HResultChecker.Check(errorBreakpoint.GetPendingBreakpoint(out pendingBreakpoint));
            var breakpoint = _pendingToBreakpoint[pendingBreakpoint];

            breakpoint.Error = errorResolutionInfo[0].bstrMessage;
            breakpoint.State = BreakpointState.Error;
        }
コード例 #8
0
        int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] info)
        {
            if ((dwFields & enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0)
            {
            }
            if ((dwFields & enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0)
            {
            }
            if ((dwFields & enum_BPERESI_FIELDS.BPERESI_THREAD) != 0)
            {
            }
            if ((dwFields & enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0)
            {
                info[0].dwFields |= enum_BPERESI_FIELDS.BPERESI_MESSAGE;
                info[0].bstrMessage = m_Message;
            }
            if ((dwFields & enum_BPERESI_FIELDS.BPERESI_TYPE) != 0)
            {
                info[0].dwFields |= enum_BPERESI_FIELDS.BPERESI_TYPE;
                info[0].dwType = m_errorType;
            }

            return VSConstants.S_OK;
        }
コード例 #9
0
 public int GetErrorResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
ファイル: AD7Events.cs プロジェクト: lioaphy/nodejstools
 int IDebugErrorBreakpointResolution2.GetResolutionInfo(enum_BPERESI_FIELDS dwFields, BP_ERROR_RESOLUTION_INFO[] pErrorResolutionInfo) {
     pErrorResolutionInfo[0].dwFields = dwFields;
     if ((dwFields & enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0) {
         pErrorResolutionInfo[0].pProgram = (IDebugProgram2)m_engine;
     }
     if ((dwFields & enum_BPERESI_FIELDS.BPERESI_THREAD) != 0) {
         pErrorResolutionInfo[0].pThread = (IDebugThread2)m_engine.MainThread;
     }
     if ((dwFields & enum_BPERESI_FIELDS.BPERESI_TYPE) != 0) {
         pErrorResolutionInfo[0].dwType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING;
     }
     if ((dwFields & enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0) {
         pErrorResolutionInfo[0].bpResLocation =  new BP_RESOLUTION_LOCATION();
         pErrorResolutionInfo[0].bpResLocation.bpType = (uint)enum_BP_TYPE.BPT_CODE;
     }
     if ((dwFields & enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0) {
         pErrorResolutionInfo[0].bstrMessage = "No code has been loaded for this code location.";
     }
     return VSConstants.S_OK;
 }
コード例 #11
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    #endregion

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    #region IDebugErrorBreakpointResolution2 Members

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public int GetResolutionInfo (enum_BPERESI_FIELDS requestedFields, BP_ERROR_RESOLUTION_INFO [] resolutionInfo)
    {
      // 
      // Gets the breakpoint resolution information.
      // 

      LoggingUtils.PrintFunction ();

      try
      {
        resolutionInfo [0] = new BP_ERROR_RESOLUTION_INFO ();

        if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0)
        {
          enum_BP_TYPE bpType;

          GetBreakpointType (out bpType);

          if (bpType == enum_BP_TYPE.BPT_CODE)
          {
            resolutionInfo [0].bpResLocation.bpType = (uint)bpType;

            resolutionInfo [0].bpResLocation.unionmember1 = Marshal.GetComInterfaceForObject (m_codeContext, typeof (IDebugCodeContext2));
          }
          else if (bpType == enum_BP_TYPE.BPT_DATA)
          {
            resolutionInfo [0].bpResLocation.bpType = (uint)bpType;

            throw new NotImplementedException ();
          }

          resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION;
        }

        if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0)
        {
          LoggingUtils.RequireOk (m_codeContext.GetProgram (out resolutionInfo [0].pProgram));

          resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_PROGRAM;
        }

        if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_THREAD) != 0)
        {
        }

        if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0)
        {
          resolutionInfo [0].bstrMessage = m_resolutionMessage;

          resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_MESSAGE;
        }

        if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_TYPE) != 0)
        {
          resolutionInfo [0].dwType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING;

          resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_TYPE;
        }

        return Constants.S_OK;
      }
      catch (NotImplementedException e)
      {
        LoggingUtils.HandleException (e);

        return Constants.E_NOTIMPL;
      }
      catch (Exception e)
      {
        LoggingUtils.HandleException (e);

        return Constants.E_FAIL;
      }
    }
コード例 #12
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #endregion

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region IDebugErrorBreakpointResolution2 Members

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int GetResolutionInfo(enum_BPERESI_FIELDS requestedFields, BP_ERROR_RESOLUTION_INFO [] resolutionInfo)
        {
            //
            // Gets the breakpoint resolution information.
            //

            LoggingUtils.PrintFunction();

            try
            {
                resolutionInfo [0] = new BP_ERROR_RESOLUTION_INFO();

                if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION) != 0)
                {
                    enum_BP_TYPE bpType;

                    GetBreakpointType(out bpType);

                    if (bpType == enum_BP_TYPE.BPT_CODE)
                    {
                        resolutionInfo [0].bpResLocation.bpType = (uint)bpType;

                        resolutionInfo [0].bpResLocation.unionmember1 = Marshal.GetComInterfaceForObject(m_codeContext, typeof(IDebugCodeContext2));
                    }
                    else if (bpType == enum_BP_TYPE.BPT_DATA)
                    {
                        resolutionInfo [0].bpResLocation.bpType = (uint)bpType;

                        throw new NotImplementedException();
                    }

                    resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_BPRESLOCATION;
                }

                if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_PROGRAM) != 0)
                {
                    LoggingUtils.RequireOk(m_codeContext.GetProgram(out resolutionInfo [0].pProgram));

                    resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_PROGRAM;
                }

                if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_THREAD) != 0)
                {
                }

                if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_MESSAGE) != 0)
                {
                    resolutionInfo [0].bstrMessage = m_resolutionMessage;

                    resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_MESSAGE;
                }

                if ((requestedFields & enum_BPERESI_FIELDS.BPERESI_TYPE) != 0)
                {
                    resolutionInfo [0].dwType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING;

                    resolutionInfo [0].dwFields |= enum_BPERESI_FIELDS.BPERESI_TYPE;
                }

                return(Constants.S_OK);
            }
            catch (NotImplementedException e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_NOTIMPL);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }