Example #1
0
 public IDebuggerCode GetCode(ILCodeKind kind)
 {
     return(debugger.Dispatcher.UI(() => {
         var code = frame.GetCode((dndbg.COM.CorDebug.ILCodeKind)kind);
         return code == null ? null : new DebuggerCode(debugger, code);
     }));
 }
Example #2
0
        /// <summary>
        /// Gets all locals
        /// </summary>
        /// <param name="kind">Kind</param>
        public IEnumerable <CorValue> GetILLocals(ILCodeKind kind)
        {
            var ilf4 = obj as ICorDebugILFrame4;

            if (ilf4 == null)
            {
                yield break;
            }
            ICorDebugValueEnum valueEnum;
            int hr = ilf4.EnumerateLocalVariablesEx(kind, out valueEnum);

            if (hr < 0)
            {
                yield break;
            }
            for (;;)
            {
                ICorDebugValue value = null;
                uint           count;
                hr = valueEnum.Next(1, out value, out count);
                if (hr != 0 || value == null)
                {
                    break;
                }
                yield return(new CorValue(value));
            }
        }
Example #3
0
 public IDebuggerValue GetLocal(ILCodeKind kind, int index)
 {
     return(debugger.Dispatcher.UI(() => {
         var value = frame.GetILLocal((dndbg.COM.CorDebug.ILCodeKind)kind, index);
         return value == null ? null : new DebuggerValue(debugger, value);
     }));
 }
Example #4
0
 public IDebuggerValue[] GetLocals(ILCodeKind kind) => debugger.Dispatcher.UI(() => {
     var list = new List <IDebuggerValue>();
     foreach (var v in CorFrame.GetILLocals((dndbg.COM.CorDebug.ILCodeKind)kind))
     {
         list.Add(new DebuggerValue(debugger, v));
     }
     return(list.ToArray());
 });
Example #5
0
        public CorCode?GetCode(ILCodeKind kind)
        {
            var ilf4 = obj as ICorDebugILFrame4;

            if (ilf4 is null)
            {
                return(null);
            }
            int hr = ilf4.GetCodeEx(kind, out var code);

            return(hr < 0 || code is null ? null : new CorCode(code));
        }
Example #6
0
        public CorValue?GetILLocal(ILCodeKind kind, uint index)
        {
            var ilf4 = obj as ICorDebugILFrame4;

            if (ilf4 is null)
            {
                return(null);
            }
            int hr = ilf4.GetLocalVariableEx(kind, index, out var value);

            return(hr < 0 || value is null ? null : new CorValue(value));
        }
Example #7
0
        /// <summary>
        /// Gets the code or null if it's not an <see cref="ICorDebugILFrame4"/> or if there was an
        /// error
        /// </summary>
        /// <param name="kind">Kind</param>
        /// <param name="index">Index of local</param>
        /// <returns></returns>
        public CorCode GetCode(ILCodeKind kind, uint index)
        {
            var ilf4 = obj as ICorDebugILFrame4;

            if (ilf4 == null)
            {
                return(null);
            }
            ICorDebugCode code;
            int           hr = ilf4.GetCodeEx(kind, out code);

            return(hr < 0 || code == null ? null : new CorCode(code));
        }
Example #8
0
 public CorValue?GetILLocal(ILCodeKind kind, int index) => GetILLocal(kind, (uint)index);
Example #9
0
 /// <summary>
 /// Gets a local variable or null if it's not an <see cref="ICorDebugILFrame4"/> or if there
 /// was an error
 /// </summary>
 /// <param name="kind">Kind</param>
 /// <param name="index">Index of local</param>
 /// <returns></returns>
 public CorValue GetILLocal(ILCodeKind kind, int index)
 {
     return(GetILLocal(kind, (uint)index));
 }
Example #10
0
		public IDebuggerCode GetCode(ILCodeKind kind) {
			return debugger.Dispatcher.UI(() => {
				var code = CorFrame.GetCode((dndbg.COM.CorDebug.ILCodeKind)kind);
				return code == null ? null : new DebuggerCode(debugger, code);
			});
		}
Example #11
0
		public IDebuggerValue GetLocal(ILCodeKind kind, int index) {
			return debugger.Dispatcher.UI(() => {
				var value = CorFrame.GetILLocal((dndbg.COM.CorDebug.ILCodeKind)kind, index);
				return value == null ? null : new DebuggerValue(debugger, value);
			});
		}
Example #12
0
		public IDebuggerValue[] GetLocals(ILCodeKind kind) {
			return debugger.Dispatcher.UI(() => {
				var list = new List<IDebuggerValue>();
				foreach (var v in CorFrame.GetILLocals((dndbg.COM.CorDebug.ILCodeKind)kind))
					list.Add(new DebuggerValue(debugger, v));
				return list.ToArray();
			});
		}