Exemple #1
0
		public object GetElement (int[] indices)
		{
			return new CorValRef (delegate {
				// If we have a zombie state array, reload it.
				if (!obj.IsValid) {
					obj.Reload ();
					array = CorObjectAdaptor.GetRealObject (ctx, obj) as CorArrayValue;
				}

				return array != null ? array.GetElement (indices) : null;
			});
		}
Exemple #2
0
		public ArrayAdaptor (EvaluationContext ctx, CorValRef obj, CorArrayValue array)
		{
			this.ctx = (CorEvaluationContext) ctx;
			this.array = array;
			this.obj = obj;
		}
Exemple #3
0
        private string PrintArray(int indentLevel, CorArrayValue av, int expandDepth, bool canDoFunceval)
        {
            Debug.Assert(expandDepth >= 0);

            StringBuilder txt = new StringBuilder();
            txt.Append("array [");
            int[] dims = av.GetDimensions();
            Debug.Assert(dims != null);

            for (int i = 0; i < dims.Length; ++i)
            {
                if (i != 0)
                    txt.Append(",");
                txt.Append(dims[i]);
            }
            txt.Append("]");

            if (expandDepth > 0 && av.Rank == 1 && av.ElementType != CorElementType.ELEMENT_TYPE_VOID)
            {
                for (int i = 0; i < dims[0]; i++)
                {
                    MDbgValue v = new MDbgValue(Process, av.GetElementAtPosition(i));
                    txt.Append("\n").Append(IndentedString(indentLevel + 1, "[" + i + "] = ")).
            Append(IndentedBlock(indentLevel + 2,
                           v.GetStringValue(expandDepth - 1, canDoFunceval)));
                }
            }
            return txt.ToString();
        }