Ejemplo n.º 1
0
 /// <summary>
 /// Adds an MDbgStopOptionPolicy object to the collection of stop option policies,
 /// and registers it for one or more types of callbacks.
 /// </summary>
 /// <param name="sop">The stop option policy to add.</param>
 /// <param name="callbackTypes">The types of callbacks to register the stop option
 /// policy for.</param>
 public void Add(MDbgStopOptionPolicy sop, ManagedCallbackType[] callbackTypes)
 {
     foreach (ManagedCallbackType callbackType in callbackTypes)
     {
         Add(sop, callbackType);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds an MDbgStopOptionPolicy object to the collection of stop option policies,
 /// and registers it for a type of callback
 /// </summary>
 /// <param name="sop">The stop option policy to add.</param>
 /// <param name="callbackType">The type of callback to register the stop option
 /// policy for.</param>
 public void Add(MDbgStopOptionPolicy sop, ManagedCallbackType callbackType)
 {
     if (m_stopOptions[(int)callbackType] == null)
     {
         m_stopOptions[(int)callbackType] = new List <MDbgStopOptionPolicy>();
     }
     m_stopOptions[(int)callbackType].Add(sop);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes an MDbgStopOptionPolicy object from the collection of stop option policies.
 /// </summary>
 /// <param name="sop">The stop option policy to remove.</param>
 public void Remove(MDbgStopOptionPolicy sop)
 {
     foreach (var policies in m_stopOptions)
     {
         if (policies != null)
         {
             if (policies.Contains(sop))
             {
                 policies.Remove(sop);
             }
         }
     }
     // If m_stopOptions does not contain the given stop option policy, do nothing.
 }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="exceptionType">An exception type or regular expression.</param>
 /// <param name="behavior">Debugger behavior - stop, log, or ignore</param>
 public ExceptionStopOptionPolicyItem(string exceptionType, MDbgStopOptionPolicy.DebuggerBehavior behavior)
 {
     ExceptionType = exceptionType;
     Behavior = behavior;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Removes an MDbgStopOptionPolicy object from the collection of stop option policies.
 /// </summary>
 /// <param name="sop">The stop option policy to remove.</param>
 public void Remove(MDbgStopOptionPolicy sop)
 {
     foreach (var policies in m_stopOptions)
     {
         if (policies != null)
         {
             if (policies.Contains(sop))
             {
                 policies.Remove(sop);
             }
         }
     }
     // If m_stopOptions does not contain the given stop option policy, do nothing. 
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds an MDbgStopOptionPolicy object to the collection of stop option policies,
 /// and registers it for one or more types of callbacks.
 /// </summary>
 /// <param name="sop">The stop option policy to add.</param>
 /// <param name="callbackTypes">The types of callbacks to register the stop option
 /// policy for.</param>
 public void Add(MDbgStopOptionPolicy sop, ManagedCallbackType[] callbackTypes)
 {
     foreach (ManagedCallbackType callbackType in callbackTypes)
     {
         Add(sop, callbackType);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Adds an MDbgStopOptionPolicy object to the collection of stop option policies,
 /// and registers it for a type of callback
 /// </summary>
 /// <param name="sop">The stop option policy to add.</param>
 /// <param name="callbackType">The type of callback to register the stop option
 /// policy for.</param>
 public void Add(MDbgStopOptionPolicy sop, ManagedCallbackType callbackType)
 {
     if (m_stopOptions[(int) callbackType] == null)
     {
         m_stopOptions[(int) callbackType] = new List<MDbgStopOptionPolicy>();
     }
     m_stopOptions[(int) callbackType].Add(sop);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Modifies all contained stop option policies with the given acronym.
 /// </summary>
 /// <param name="acronym">Stop option policy acronym.</param>
 /// <param name="option">Desired debugger behavior - stop, log, or ignore.</param>
 /// <param name="arguments">Arguments to pass to the stop option policy.</param>
 public void ModifyOptions(string acronym, MDbgStopOptionPolicy.DebuggerBehavior option, string arguments)
 {
     int matchingPolicies = 0;
     foreach (MDbgStopOptionPolicy sop in Policies())
     {
         if (sop.Acronym == acronym)
         {
             sop.SetBehavior(option, arguments);
             matchingPolicies++;
         }
     }
     if (matchingPolicies == 0)
     {
         //no stop option policies exist that match the given acronym
         throw new MDbgShellException("Unrecognized option");
     }
 }
Ejemplo n.º 9
0
        private static void ModifyStopOptions(MDbgStopOptionPolicy.DebuggerBehavior command, string arguments)
        {
            var stopOptions = Shell.Properties[MDbgStopOptions.PropertyName]
                              as MDbgStopOptions;

            if (arguments.Length < 2)
            {
                DisplayStopOptions();
            }
            else
            {
                // Break up arguments string into the event type acronym and the arguments to 
                // send to the actual stop option policy. For example, if the arguments string
                // is "ex System.Exception System.ArgumentException", this will be split into:
                // eventType = "ex"
                // args = "System.Exception System.ArgumentException"
                // If there are no arguments to send to the stop option policy, args is set to null.
                string eventType = arguments.Split()[0].Trim();
                string args = null;
                if (arguments.Length > eventType.Length)
                {
                    args = arguments.Substring(eventType.Length).Trim();
                }
                stopOptions.ModifyOptions(eventType, command, args);
            }
        }