Esempio n. 1
0
        public RuntimeValue CallMemberFunction(RuntimeThread thread, SymbolToken token, params RuntimeValue[] arguments)
        {
            ICorDebugFunction comFunction;

            ComObjectValue.GetVirtualMethod((uint)token.GetToken(), out comFunction);

            var evaluation = thread.CreateEvaluation();

            evaluation.Call(comFunction, arguments.GetComValues().ToArray());

            if (evaluation.WaitForResult(1000))
            {
                return(evaluation.Result);
            }

            throw new TimeoutException("Evaluation timed out.");
        }
Esempio n. 2
0
        public RuntimeValue GetFieldValue(RuntimeThread thread, SymbolToken token)
        {
            // TODO: static members

            if (!IsObject)
            {
                throw new InvalidOperationException("Value must be an object in order to get values of fields.");
            }

            RuntimeValue value;

            if (!_fieldValues.TryGetValue(token, out value))
            {
                ICorDebugValue comValue;
                ComObjectValue.GetFieldValue(Type.Class.ComClass, (uint)token.GetToken(), out comValue);
                _fieldValues.Add(token, value = new RuntimeValue(Session, comValue));
            }
            return(value);
        }