Exemple #1
0
        internal static BreakOn GetBreakOnForPassCount(BP_PASSCOUNT bpPassCount)
        {
            BreakOn breakOn;
            var     count = bpPassCount.dwPassCount;

            switch (bpPassCount.stylePassCount)
            {
            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE:
                breakOn = new BreakOn(BreakOnKind.Always, count);
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                breakOn = new BreakOn(BreakOnKind.Equal, count);
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                breakOn = new BreakOn(BreakOnKind.GreaterThanOrEqual, count);
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                breakOn = new BreakOn(BreakOnKind.Mod, count);
                break;

            default:
                breakOn = new BreakOn(BreakOnKind.Always, count);
                break;
            }
            return(breakOn);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            //
            // Sets or changes the pass count associated with this pending breakpoint.
            //

            LoggingUtils.PrintFunction();

            try
            {
                if (m_breakpointDeleted)
                {
                    return(Constants.E_BP_DELETED);
                }

                foreach (DebuggeeBreakpointBound boundBreakpoint in m_boundBreakpoints.ToArray())
                {
                    LoggingUtils.RequireOk(boundBreakpoint.SetPassCount(bpPassCount));
                }

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

                return(Constants.E_FAIL);
            }
        }
Exemple #3
0
        // Token: 0x0600003B RID: 59 RVA: 0x00002EC8 File Offset: 0x000010C8
        public virtual int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            switch (bpPassCount.stylePassCount)
            {
            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE:
                this.Handle.HitCountMode = HitCountMode.None;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                this.Handle.HitCountMode = HitCountMode.EqualTo;
                this.Handle.HitCount     = (int)bpPassCount.dwPassCount;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                this.Handle.HitCountMode = HitCountMode.GreaterThanOrEqualTo;
                this.Handle.HitCount     = (int)bpPassCount.dwPassCount;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                this.Handle.HitCountMode = HitCountMode.MultipleOf;
                this.Handle.HitCount     = (int)bpPassCount.dwPassCount;
                break;
            }
            return(0);
        }
        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            _monoBreakpoint.HitCount = (int)bpPassCount.dwPassCount;

            switch (bpPassCount.stylePassCount)
            {
            case (uint)enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                _monoBreakpoint.HitCountMode = HitCountMode.EqualTo;
                break;

            case (uint)enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                _monoBreakpoint.HitCountMode = HitCountMode.GreaterThanOrEqualTo;
                break;

            case (uint)enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                _monoBreakpoint.HitCountMode = HitCountMode.MultipleOf;
                break;

            case (uint)enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE:
                _monoBreakpoint.HitCountMode = HitCountMode.None;
                break;
            }

            return(S_OK);
        }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugBoundBreakpoint.SetPassCount");
     if (IsDeleted)
     {
         return(HResults.E_BP_DELETED);
     }
     return(pendingBreakpoint.SetPassCount(bpPassCount));
 }
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         this.SetError(new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR), true);
         return(Constants.E_FAIL);
     }
     return(Constants.S_OK);
 }
        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            if (_deleted)
            {
                return(AD7Constants.E_BP_DELETED);
            }

            throw new NotImplementedException();
        }
Exemple #8
0
 // The sample engine does not support pass counts on breakpoints.
 // This is used to specify the breakpoint hit count condition.
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         Delete();
         _engine.Callback.OnBreakpointUnbound(this, enum_BP_UNBOUND_REASON.BPUR_BREAKPOINT_ERROR);
         return(Constants.E_FAIL);
     }
     return(Constants.S_OK);
 }
Exemple #9
0
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         _BPError = new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR);
         _engine.Callback.OnBreakpointError(_BPError);
         return(VSConstants.E_FAIL);
     }
     return(VSConstants.S_OK);
 }
Exemple #10
0
        public int SetPassCount(BP_PASSCOUNT breakpointPassCount)
        {
            if (_deleted)
            {
                return(AD7Constants.E_BP_DELETED);
            }

            _breakpointCondition.PassCount = breakpointPassCount;

            return(VSConstants.S_OK);
        }
Exemple #11
0
        int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            AssertMainThread();

            var breakOn = GetBreakOnForPassCount(bpPassCount);

            if (!this._breakpointBinding.SetBreakOnAsync(breakOn).GetAwaiter().GetResult())
            {
                return(VSConstants.E_FAIL);
            }

            return(VSConstants.S_OK);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public virtual int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            //
            // Sets or change the pass count associated with this bound breakpoint.
            //

            LoggingUtils.PrintFunction();

            if (m_breakpointDeleted)
            {
                return(Constants.E_BP_DELETED);
            }

            return(Constants.S_OK);
        }
        // SetIgnoreCount method works differently for watchpoints and
        // breakpoints. For breakpoints it configures the number of times the
        // breakpoint is skipped before hitting, starting from the moments this
        // property is set up. For watchpoints it counts all hits that already
        // happened. For example, if the current hit count for breakpoint is 5
        // and you set ignore count to 5, the next time it will stop on 10.
        //  But for watchpoint it will stop on 6.
        public int SetPassCount(BP_PASSCOUNT breakpointPassCount)
        {
            if (_deleted)
            {
                return(AD7Constants.E_BP_DELETED);
            }
            if (_lldbWatchpoint == null)
            {
                return(VSConstants.S_OK);
            }
            _passCount = breakpointPassCount;
            _lldbWatchpoint.SetEnabled(_enabled);
            _disabledByPassCount = false;
            GetHitCount(out uint hitCount);
            switch (breakpointPassCount.stylePassCount)
            {
            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE:
                _lldbWatchpoint.SetIgnoreCount(0);
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                _lldbWatchpoint.SetIgnoreCount(
                    (uint)Math.Max(0, _baseHitCount + (int)breakpointPassCount.dwPassCount - 1));
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                if (breakpointPassCount.dwPassCount > hitCount)
                {
                    _lldbWatchpoint.SetIgnoreCount((uint)Math.Max(
                                                       0, _baseHitCount + (int)breakpointPassCount.dwPassCount - 1));
                }
                else
                {
                    // Current hit count is already beyond the specified pass count.
                    // The watchpoint will not break.
                    _lldbWatchpoint.SetEnabled(false);
                    _disabledByPassCount = true;
                }
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                _lldbWatchpoint.SetIgnoreCount((uint)Math.Max(
                                                   0, _baseHitCount + (int)hitCount + (int)breakpointPassCount.dwPassCount -
                                                   (int)hitCount % breakpointPassCount.dwPassCount - 1));
                break;
            }
            return(VSConstants.S_OK);
        }
Exemple #14
0
        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            Debug.WriteLine("AD7Breakpoint: SetPassCount");
            EnumBreakpointPassCountStyle style = EnumBreakpointPassCountStyle.None;

            switch (bpPassCount.stylePassCount)
            {
            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                style = EnumBreakpointPassCountStyle.Equal;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                style = EnumBreakpointPassCountStyle.EqualOrGreater;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                style = EnumBreakpointPassCountStyle.Mod;
                break;
            }
            CoreBreakpoint.SetPassCount(bpPassCount.dwPassCount, style);
            return(VSConstants.S_OK);
        }
Exemple #15
0
        public int SetPassCount(BP_PASSCOUNT passCount)
        {
            breakpoint.HitCount = (int)passCount.dwPassCount;
            switch (passCount.stylePassCount)
            {
            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                breakpoint.HitCountMode = HitCountMode.EqualTo;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                breakpoint.HitCountMode = HitCountMode.GreaterThanOrEqualTo;
                break;

            case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                breakpoint.HitCountMode = HitCountMode.None;
                return(VSConstants.E_NOTIMPL);

            default:
                breakpoint.HitCountMode = HitCountMode.None;
                break;
            }

            return(VSConstants.S_OK);
        }
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     throw new NotImplementedException();
 }
Exemple #17
0
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     _breakpoint.SetPassCount(bpPassCount.stylePassCount.ToPython(), (int)bpPassCount.dwPassCount);
     return(VSConstants.S_OK);
 }
Exemple #18
0
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     _bpRequestInfo.bpPassCount = bpPassCount;
     return(VSConstants.S_OK);
 }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
   Debug.WriteLine("AD7Breakpoint: SetPassCount");
   EnumBreakpointPassCountStyle style = EnumBreakpointPassCountStyle.None;
   switch (bpPassCount.stylePassCount)
   {
     case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
       style = EnumBreakpointPassCountStyle.Equal;
       break;
     case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
       style = EnumBreakpointPassCountStyle.EqualOrGreater;
       break;
     case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
       style = EnumBreakpointPassCountStyle.Mod;
       break;
   }
   CoreBreakpoint.SetPassCount(bpPassCount.dwPassCount, style);
   return VSConstants.S_OK;
 }
Exemple #20
0
 // The sample engine does not support pass counts on breakpoints.
 // This is used to specify the breakpoint hit count condition.
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     throw new NotImplementedException();
 }
Exemple #21
0
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount) {
     _breakpoint.SetPassCount(bpPassCount.stylePassCount.ToPython(), (int)bpPassCount.dwPassCount);
     return VSConstants.S_OK;
 }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public override int SetPassCount (BP_PASSCOUNT bpPassCount)
    {
      // 
      // Sets or change the pass count associated with this bound breakpoint.
      // 

      LoggingUtils.PrintFunction ();

      try
      {
        int handle = base.SetPassCount (bpPassCount);

        if (handle == Constants.E_BP_DELETED)
        {
          return handle;
        }

        LoggingUtils.RequireOk (handle);

        uint passCount = 0;

        switch (bpPassCount.stylePassCount)
        {
          case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
          {
            goto case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER;
          }

          case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
          {
            passCount = bpPassCount.dwPassCount - 1;

            break;
          }

          case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
          {
            throw new NotImplementedException ();
          }
        }

        m_debugger.RunInterruptOperation (delegate (CLangDebugger debugger)
        {
          string command = string.Format ("-break-after {0} {1}", GdbBreakpoint.ID, passCount);

          debugger.GdbClient.SendCommand (command, delegate (MiResultRecord resultRecord)
          {
            MiResultRecord.RequireOk (resultRecord, command);
          });
        });

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

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

        return Constants.E_FAIL;
      }
    }
Exemple #23
0
 // Token: 0x060000DB RID: 219 RVA: 0x000045F1 File Offset: 0x000027F1
 public virtual int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(-2147467263);
 }
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(VSConstants.E_NOTIMPL);
 }
 internal static BreakOn GetBreakOnForPassCount(BP_PASSCOUNT bpPassCount) {
     BreakOn breakOn;
     uint count = bpPassCount.dwPassCount;
     switch (bpPassCount.stylePassCount) {
         case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE:
             breakOn = new BreakOn(BreakOnKind.Always, count);
             break;
         case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
             breakOn = new BreakOn(BreakOnKind.Equal, count);
             break;
         case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
             breakOn = new BreakOn(BreakOnKind.GreaterThanOrEqual, count);
             break;
         case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
             breakOn = new BreakOn(BreakOnKind.Mod, count);
             break;
         default:
             breakOn = new BreakOn(BreakOnKind.Always, count);
             break;
     }
     return breakOn;
 }
Exemple #26
0
 /// <summary>
 /// Sets or changes the pass count associated with this pending breakpoint.
 /// </summary>
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPendingBreakpoint.SetPassCount");
     throw new NotImplementedException();
 }
 /// <summary>
 ///     Sets or change the pass count associated with this bound breakpoint.
 /// </summary>
 /// <param name="bpPassCount">The bp pass count.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(S_OK);
 }
Exemple #28
0
 // The sample engine does not support pass counts on breakpoints.
 // This is used to specify the breakpoint hit count condition.
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     //throw new NotImplementedException();
     return(EngineConstants.E_NOTIMPL);
 }
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount) {
     return VSConstants.E_NOTIMPL;
 }
        int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount) {
            AssertMainThread();

            BreakOn breakOn = GetBreakOnForPassCount(bpPassCount);
            if (!_breakpointBinding.SetBreakOnAsync(breakOn).GetAwaiter().GetResult()) {
                return VSConstants.E_FAIL;
            }

            return VSConstants.S_OK;
        }
Exemple #31
0
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount) {
     _bpRequestInfo.bpPassCount = bpPassCount;
     return VSConstants.S_OK;
 }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     Log.Debug("ScriptBreakpoint: SetPassCount");
     return VSConstants.E_NOTIMPL;
 }
 // The sample engine does not support pass counts on breakpoints.
 // This is used to specify the breakpoint hit count condition.
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         Delete();
         _engine.Callback.OnBreakpointUnbound(this, enum_BP_UNBOUND_REASON.BPUR_BREAKPOINT_ERROR);
         return Constants.E_FAIL;
     }
     return Constants.S_OK;
 }
 /// <summary>
 /// Sets or changes the pass count associated with this pending breakpoint.
 /// </summary>
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPendingBreakpoint.SetPassCount");
     throw new NotImplementedException();
 }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     throw new NotImplementedException();
 }
Exemple #36
0
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(VSConstants.S_OK);
 }
Exemple #37
0
 /// <summary>
 /// Sets or changes the pass count associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
 /// </summary>
 /// <param name="bpPassCount"> Specifies the pass count. </param>
 /// <returns> VSConstants.S_OK if successful, VSConstants.S_FALSE if not. </returns>
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(SetPassCount(bpPassCount));
 }
Exemple #38
0
 /// <summary>
 /// Sets or changes the pass count associated with the pending breakpoint.
 /// </summary>
 /// <param name="bpPassCount">A BP_PASSCOUNT structure that contains the pass count.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code. Returns E_BP_DELETED if the breakpoint has been deleted.</returns>
 /// <remarks>Any pass count that was previously associated with the pending breakpoint is lost. All breakpoints bound from this pending breakpoint are called to set their pass count to the bpPassCount parameter.</remarks>
 public virtual int SetPassCount( BP_PASSCOUNT bpPassCount )
 {
     Logger.Debug( string.Empty );
     return VSConstants.E_NOTIMPL;
 }
Exemple #39
0
        /// <summary>
        ///  Sets the count and conditions upon which a breakpoint is fired.
        ///  (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
        /// </summary>
        /// <param name="bpPassCount"> Describes the count and conditions upon which a conditional breakpoint is fired. </param>
        /// <returns> VSConstants.S_OK if successful, VSConstants.S_FALSE if not. </returns>
        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            bool isRunning = false;
            int  result    = VSConstants.S_FALSE;

            while (!m_engine.eDispatcher.lockedBreakpoint(this, true, false))
            {
                Thread.Sleep(0);
            }
            while (!m_engine.eDispatcher.enterCriticalRegion())
            {
                Thread.Sleep(0);
            }
            if ((m_engine.m_state == AD7Engine.DE_STATE.RUN_MODE) && (EventDispatcher.m_GDBRunMode == true))
            {
                isRunning = true;
                m_engine.eDispatcher.prepareToModifyBreakpoint();
            }
            m_bpPassCount = bpPassCount;
            if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER)
            {
                m_isHitCountEqual  = false;
                m_hitCountMultiple = 0;
                if (!m_breakWhenCondChanged)
                {
                    if ((int)((bpPassCount.dwPassCount - m_hitCount)) >= 0)
                    {
                        if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
                        {
                            result = VSConstants.S_OK;
                        }
                    }
                    else
                    {
                        if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1))
                        {
                            result = VSConstants.S_OK;
                        }
                    }
                }
                else
                {
                    result = VSConstants.S_OK;
                }
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL)
            {
                m_hitCountMultiple = 0;
                m_isHitCountEqual  = true;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
                    {
                        result = VSConstants.S_OK;
                    }
                }
                else
                {
                    result = VSConstants.S_OK;
                }
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD)
            {
                m_isHitCountEqual  = false;
                m_hitCountMultiple = bpPassCount.dwPassCount;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(m_hitCountMultiple - (m_hitCount % m_hitCountMultiple))))
                    {
                        result = VSConstants.S_OK;
                    }
                }
                else
                {
                    result = VSConstants.S_OK;
                }
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
            {
                m_isHitCountEqual  = false;
                m_hitCountMultiple = 0;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1)) // ignoreHitCount decrement by 1 automatically, so sending 1 means to stop ignoring (or ignore 0)
                    {
                        result = VSConstants.S_OK;
                    }
                }
                else
                {
                    result = VSConstants.S_OK;
                }
            }

            if (isRunning)
            {
                isRunning = false;
                m_engine.eDispatcher.resumeFromInterrupt();
            }

            m_engine.eDispatcher.leaveCriticalRegion();
            m_engine.eDispatcher.unlockBreakpoint(this, true, false);
            return(result);
        }
 /// <summary>
 /// Sets or changes the pass count associated with this bound breakpoint. (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
 /// </summary>
 /// <param name="bpPassCount"> Specifies the pass count. </param>
 /// <returns> VSConstants.S_OK if successful, VSConstants.S_FALSE if not. </returns>
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return SetPassCount(bpPassCount);
 }
 // The sample engine does not support pass counts on breakpoints.
 int IDebugPendingBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     if (bpPassCount.stylePassCount != enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
     {
         this.SetError(new AD7ErrorBreakpoint(this, ResourceStrings.UnsupportedPassCountBreakpoint, enum_BP_ERROR_TYPE.BPET_GENERAL_ERROR), true);
         return Constants.E_FAIL;
     }
     return Constants.S_OK;
 }
        /// <summary>
        ///  Sets the count and conditions upon which a breakpoint is fired. 
        ///  (http://msdn.microsoft.com/en-us/library/bb161364.aspx)
        /// </summary>
        /// <param name="bpPassCount"> Describes the count and conditions upon which a conditional breakpoint is fired. </param>
        /// <returns> VSConstants.S_OK if successful, VSConstants.S_FALSE if not. </returns>
        public int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            bool isRunning = false;
            int result = VSConstants.S_FALSE;
            while (!m_engine.eDispatcher.lockedBreakpoint(this, true, false))
            {
                Thread.Sleep(0);
            }
            while (!m_engine.eDispatcher.enterCriticalRegion())
            {
                Thread.Sleep(0);
            }
            if ((m_engine.m_state == AD7Engine.DE_STATE.RUN_MODE) && (EventDispatcher.m_GDBRunMode == true))
            {
                isRunning = true;
                m_engine.eDispatcher.prepareToModifyBreakpoint();
            }
            m_bpPassCount = bpPassCount;
            if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER)
            {
                m_isHitCountEqual = false;
                m_hitCountMultiple = 0;
                if (!m_breakWhenCondChanged)
                {
                    if ((int)((bpPassCount.dwPassCount - m_hitCount)) >= 0)
                    {
                        if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
                            result = VSConstants.S_OK;
                    }
                    else
                    {
                        if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1))
                            result = VSConstants.S_OK;
                    }

                }
                else
                    result = VSConstants.S_OK;
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL)
            {
                m_hitCountMultiple = 0;
                m_isHitCountEqual = true;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(bpPassCount.dwPassCount - m_hitCount)))
                        result = VSConstants.S_OK;
                }
                else
                    result = VSConstants.S_OK;
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD)
            {
                m_isHitCountEqual = false;
                m_hitCountMultiple = bpPassCount.dwPassCount;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, (int)(m_hitCountMultiple - (m_hitCount % m_hitCountMultiple))))
                        result = VSConstants.S_OK;
                }
                else
                    result = VSConstants.S_OK;
            }
            else if (bpPassCount.stylePassCount == enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_NONE)
            {
                m_isHitCountEqual = false;
                m_hitCountMultiple = 0;
                if (!m_breakWhenCondChanged)
                {
                    if (m_engine.eDispatcher.ignoreHitCount(GDB_ID, 1)) // ignoreHitCount decrement by 1 automatically, so sending 1 means to stop ignoring (or ignore 0)
                        result = VSConstants.S_OK;
                }
                else
                    result = VSConstants.S_OK;
            }

            if (isRunning)
            {
                isRunning = false;
                m_engine.eDispatcher.resumeFromInterrupt();
            }

            m_engine.eDispatcher.leaveCriticalRegion();
            m_engine.eDispatcher.unlockBreakpoint(this, true, false);
            return result;
        }
Exemple #43
0
 int IDebugBoundBreakpoint2.SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     TaskHelpers.RunSynchronouslyOnUIThread(ct => _breakpoint.SetPassCountAsync(bpPassCount.stylePassCount.ToPython(), (int)bpPassCount.dwPassCount, ct));
     return(VSConstants.S_OK);
 }
Exemple #44
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public override int SetPassCount(BP_PASSCOUNT bpPassCount)
        {
            //
            // Sets or change the pass count associated with this bound breakpoint.
            //

            LoggingUtils.PrintFunction();

            try
            {
                int handle = base.SetPassCount(bpPassCount);

                if (handle == Constants.E_BP_DELETED)
                {
                    return(handle);
                }

                LoggingUtils.RequireOk(handle);

                uint passCount = 0;

                switch (bpPassCount.stylePassCount)
                {
                case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL:
                {
                    goto case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER;
                }

                case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER:
                {
                    passCount = bpPassCount.dwPassCount - 1;

                    break;
                }

                case enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_MOD:
                {
                    throw new NotImplementedException();
                }
                }

                m_debugger.RunInterruptOperation(delegate(CLangDebugger debugger)
                {
                    string command = string.Format("-break-after {0} {1}", GdbBreakpoint.ID, passCount);

                    debugger.GdbClient.SendCommand(command, delegate(MiResultRecord resultRecord)
                    {
                        MiResultRecord.RequireOk(resultRecord, command);
                    });
                });

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

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

                return(Constants.E_FAIL);
            }
        }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     _passCount = bpPassCount;
     return VSConstants.S_OK;
 }
Exemple #46
0
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return(VSConstants.E_NOTIMPL);
 }
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     throw new NotImplementedException();
 }
Exemple #48
0
 public int SetPassCount(BP_PASSCOUNT bpPassCount)
 {
     return VSConstants.E_NOTIMPL;
 }