/// <summary> /// Sets the ExceptionEnhanced switch of the associated ExceptionStopOptionPolicy object /// on or off. /// </summary> /// <param name="behavior">DebuggerBehaviors.stop turns ON ExceptionEnhanced switch of the associated /// ExceptionStopOptionPolicy object, and DebuggerBehaviors.ignore turns the switch OFF. The command /// DebuggerBehaviors.log is not supported.</param> /// <param name="arguments">Must be null.</param> public override void SetBehavior(DebuggerBehavior behavior, string arguments) { if (arguments != null) { throw new MDbgShellException("This event type does not accept arguments."); } switch (behavior) { case DebuggerBehavior.Stop: m_esop.ExceptionEnhancedOn = true; break; case DebuggerBehavior.Ignore: m_esop.ExceptionEnhancedOn = false; break; case DebuggerBehavior.Log: throw new MDbgShellException( "ExceptionEnhanced can only be switched on and off, using the catch and ignore commands."); } // To preserve legacy behavior, if m_esop contains no MDbgExceptionPolicyItem objects // describing debugger behaviors for specific exception types, and the default behavior // is not log, then the command "catch ee" will set the default behavior of m_esop // to stop, and "ignore ee" will set it to ignore. if ((m_esop.ItemsCount() == 0) && (behavior == DebuggerBehavior.Stop || behavior == DebuggerBehavior.Ignore) && (m_esop.Default != DebuggerBehavior.Log)) { m_esop.SetBehavior(behavior, null); } }