示例#1
0
        /// <summary>
        ///     Extracts the access breakpoints
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="startingIndex">The i.</param>
        /// <param name="arg">The argument.</param>
        /// <param name="options">The options.</param>
        /// <exception cref="FormatException"></exception>
        /// <exception cref="ArgumentException"></exception>
        /// <exception cref="System.FormatException"></exception>
        /// <exception cref="System.ArgumentException"></exception>
        internal static void ExtractAccessBreakpoints(string[] args, int startingIndex, string arg,
                                                      IndexOptions options)
        {
            var accessBreakpoints = new List <AccessBreakpoint>();

            for (var j = startingIndex + 1; j < args.Length; j++)
            {
                var ptr = args[j];
                if (Switches.Contains(ptr))
                {
                    break;
                }
                try
                {
                    var bp = AccessBreakpoint.Parse(ptr);
                    accessBreakpoints.Add(bp);
                }
                catch (Exception e)
                {
                    throw new FormatException($"Unable to parse {ptr} as an access breakpoint", e);
                }
            }

            if (!accessBreakpoints.Any())
            {
                throw new ArgumentException($"No memory ranges provided to {arg}");
            }
            options.AccessBreakpoints = accessBreakpoints;
        }
示例#2
0
 internal virtual int ExtractAccessBreakpoints(string[] args, int startingIndex, string arg, IndexOptions options)
 {
     var accessBreakpoints = new List<AccessBreakpoint>();
     int j;
     for (j = startingIndex + 1; j < args.Length; j++)
     {
         var ptr = args[j];
         if (Switches.Contains(ptr))
             break;
         AccessBreakpoint bp;
         try
         {
             bp = AccessBreakpoint.Parse(ptr);
         }
         catch (FormatException e)
         {
             throw new FormatException($"Cannot parse the argument \"{ptr}\" as an access breakpoint for {arg}", e);
         }
         accessBreakpoints.Add(bp);
     }
     options.AccessBreakpoints = accessBreakpoints;
     return j - 1;
 }