示例#1
0
        public static CorDebugClass ClassFromRuntimeValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
        {
            RuntimeValue_Reflection rtvf = rtv as RuntimeValue_Reflection;
            CorDebugClass           cls  = null;
            object objBuiltInKey         = null;

            Debug.Assert(!rtv.IsNull);

            if (rtvf != null)
            {
                objBuiltInKey = rtvf.ReflectionType;
            }
            else if (rtv.DataType == RuntimeDataType.DATATYPE_TRANSPARENT_PROXY)
            {
                objBuiltInKey = RuntimeDataType.DATATYPE_TRANSPARENT_PROXY;
            }
            else
            {
                cls = TinyCLR_TypeSystem.CorDebugClassFromTypeIndex(rtv.Type, appDomain);
            }

            if (objBuiltInKey != null)
            {
                CorDebugProcess.BuiltinType builtInType = appDomain.Process.ResolveBuiltInType(objBuiltInKey);

                cls = builtInType.GetClass(appDomain);

                if (cls == null)
                {
                    cls = new CorDebugClass(builtInType.GetAssembly(appDomain), builtInType.TokenCLR);
                }
            }

            return(cls);
        }
示例#2
0
		public static CorDebugClass ClassFromRuntimeValue (RuntimeValue rtv, CorDebugAppDomain appDomain)
		{
			RuntimeValue_Reflection rtvf = rtv as RuntimeValue_Reflection;
			CorDebugClass cls = null;
			object objBuiltInKey = null;
			Debug.Assert (!rtv.IsNull);

			if (rtvf != null) {
				objBuiltInKey = rtvf.ReflectionType;
			} else if (rtv.DataType == RuntimeDataType.DATATYPE_TRANSPARENT_PROXY) {
				objBuiltInKey = RuntimeDataType.DATATYPE_TRANSPARENT_PROXY;
			} else {
				cls = TinyCLR_TypeSystem.CorDebugClassFromTypeIndex (rtv.Type, appDomain);
			}

			if (objBuiltInKey != null) {                
				CorDebugProcess.BuiltinType builtInType = appDomain.Process.ResolveBuiltInType (objBuiltInKey);             
                
				cls = builtInType.GetClass (appDomain);

				if (cls == null) {
					cls = new CorDebugClass (builtInType.GetAssembly (appDomain), builtInType.TokenCLR);
				}                
			}

			return cls;
		}
示例#3
0
 //Object or CLASS, or VALUETYPE
 public CorDebugValueObject(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
     if (!rtv.IsNull)
     {
         m_class    = CorDebugValue.ClassFromRuntimeValue(rtv, appDomain);
         m_fIsEnum  = m_class.IsEnum;
         m_fIsBoxed = rtv.IsBoxed;
     }
 }
示例#4
0
        public static CorDebugValue CreateValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
        {
            CorDebugValue val = null;
            bool          fIsReference;

            if (rtv.IsBoxed)
            {
                val          = new CorDebugValueBoxedObject(rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.IsPrimitive)
            {
                CorDebugClass c = ClassFromRuntimeValue(rtv, appDomain);

                if (c.IsEnum)
                {
                    val          = new CorDebugValueObject(rtv, appDomain);
                    fIsReference = false;
                }
                else
                {
                    val          = new CorDebugValuePrimitive(rtv, appDomain);
                    fIsReference = false;
                }
            }
            else if (rtv.IsArray)
            {
                val          = new CorDebugValueArray(rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.CorElementType == CorElementType.ELEMENT_TYPE_STRING)
            {
                val          = new CorDebugValueString(rtv, appDomain);
                fIsReference = true;
            }
            else
            {
                val          = new CorDebugValueObject(rtv, appDomain);
                fIsReference = !rtv.IsValueType;
            }

            if (fIsReference)
            {
                val = new CorDebugValueReference(val, val.m_rtv, val.m_appDomain);
            }

            if (rtv.IsReference)                  //CorElementType.ELEMENT_TYPE_BYREF
            {
                val = new CorDebugValueReferenceByRef(val, val.m_rtv, val.m_appDomain);
            }

            return(val);
        }
示例#5
0
        private CorDebugClass GetClassFromToken(uint tk, Hashtable ht)
        {
            CorDebugClass cls = null;

            Pdbx.Class c = ht [tk] as Pdbx.Class;
            if (c != null)
            {
                cls = new CorDebugClass(this, c);
            }

            return(cls);
        }
示例#6
0
        public static CorDebugClass CorDebugClassFromTypeIndex(uint typeIndex, CorDebugAppDomain appDomain)
        {
            CorDebugClass cls = null;

            CorDebugAssembly assembly = appDomain.AssemblyFromIdx(TinyCLR_TypeSystem.IdxAssemblyFromIndex(typeIndex));

            if (assembly != null)
            {
                uint typedef = TinyCLR_TypeSystem.CLR_TkFromType(TinyCLR_TypeSystem.CLR_TABLESENUM.TBL_TypeDef, TinyCLR_TypeSystem.IdxFromIndex(typeIndex));
                cls = assembly.GetClassFromTokenTinyCLR(typedef);
            }

            return(cls);
        }
示例#7
0
        private CorDebugFunction GetFunctionFromToken(uint tk, Hashtable ht)
        {
            CorDebugFunction function = null;

            Pdbx.Method method = ht [tk] as Pdbx.Method;
            if (method != null)
            {
                CorDebugClass c = new CorDebugClass(this, method.Class);
                function = new CorDebugFunction(c, method);
            }

            Debug.Assert(function != null);
            return(function);
        }
示例#8
0
        private uint GetTypeDef_Index(CorElementType elementType, CorDebugClass pElementClass)
        {
            uint tdIndex;

            if (pElementClass != null)
            {
                tdIndex = pElementClass.TypeDef_Index;
            }
            else
            {
                CorDebugProcess.BuiltinType builtInType = this.Process.ResolveBuiltInType(elementType);
                tdIndex = builtInType.GetClass(this.m_appDomain).TypeDef_Index;
            }

            return(tdIndex);
        }
        int ICorDebugEval.NewObject(ICorDebugFunction pConstructor, uint nArgs, ICorDebugValue[] ppArgs)
        {
            Debug.Assert(nArgs == ppArgs.Length);

            CorDebugFunction f = (CorDebugFunction)pConstructor;
            CorDebugClass    c = f.Class;

            this.Process.SetCurrentAppDomain(this.AppDomain);
            Engine.AllocateObject(GetScratchPadLocation(), c.TypeDef_Index);

            ICorDebugValue[] args = new ICorDebugValue[nArgs + 1];

            args[0] = GetResultValue();
            ppArgs.CopyTo(args, 1);
            ((ICorDebugEval)this).CallFunction(pConstructor, (uint)args.Length, args);

            return(Utility.COM_HResults.S_OK);
        }
示例#10
0
        public CorDebugFunction GetFunctionFromTokenTinyCLR(uint tk)
        {
            if (HasSymbols)
            {
                return(GetFunctionFromToken(tk, m_htTokenTinyCLRToPdbx));
            }
            else
            {
                uint index = TinyCLR_TypeSystem.ClassMemberIndexFromTinyCLRToken(tk, this);

                WireProtocol.Commands.Debugging_Resolve_Method.Result resolvedMethod = this.Process.Engine.ResolveMethod(index);
                Debug.Assert(TinyCLR_TypeSystem.IdxAssemblyFromIndex(resolvedMethod.m_td) == this.Idx);

                uint tkMethod = TinyCLR_TypeSystem.SymbollessSupport.MethodDefTokenFromTinyCLRToken(tk);
                uint tkClass  = TinyCLR_TypeSystem.TinyCLRTokenFromTypeIndex(resolvedMethod.m_td);

                CorDebugClass c = GetClassFromTokenTinyCLR(tkClass);

                return(new CorDebugFunction(c, tkMethod));
            }
        }
 public ManagedCallbackClass(CorDebugClass c, EventType eventType)
 {
     m_class     = c;
     m_eventType = eventType;
 }
 public CorDebugFunction(CorDebugClass cls, uint tkSymbolless) : this(cls, null)
 {
     m_tkSymbolless = tkSymbolless;
 }
 public CorDebugFunction(CorDebugClass cls, Pdbx.Method method)
 {
     m_class      = cls;
     m_pdbxMethod = method;
 }
 public CorDebugFunction(CorDebugClass cls, Pdbx.Method method)
 {
     m_class = cls;
     m_pdbxMethod = method;            
 }
示例#15
0
        private uint GetTypeDef_Index(CorElementType elementType, CorDebugClass pElementClass)
        {
            uint tdIndex;

            if (pElementClass != null)
            {
                tdIndex = pElementClass.TypeDef_Index;
            }
            else
            {
                CorDebugProcess.BuiltinType builtInType = this.Process.ResolveBuiltInType(elementType);
                tdIndex = builtInType.GetClass(this.m_appDomain).TypeDef_Index;
            }

            return tdIndex;
        }
示例#16
0
		//Object or CLASS, or VALUETYPE
		public CorDebugValueObject (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
			if (!rtv.IsNull) {
				m_class = CorDebugValue.ClassFromRuntimeValue (rtv, appDomain);
				m_fIsEnum = m_class.IsEnum;
				m_fIsBoxed = rtv.IsBoxed;                
			}
		}
        private CorDebugClass GetClassFromToken( uint tk, Hashtable ht )
        {
            CorDebugClass cls = null;
            Pdbx.Class c = ht[tk] as Pdbx.Class;
            if(c != null)
            {
                cls = new CorDebugClass( this, c );
            }

            return cls;
        }
        private CorDebugFunction GetFunctionFromToken( uint tk, Hashtable ht )
        {
            CorDebugFunction function = null;
            Pdbx.Method method = ht[tk] as Pdbx.Method;
            if(method != null)
            {
                CorDebugClass c = new CorDebugClass( this, method.Class );
                function = new CorDebugFunction( c, method );
            }

            Debug.Assert( function != null );
            return function;
        }
		int ICorDebugManagedCallback.UnloadClass (CorDebugAppDomain pAppDomain, CorDebugClass c)
		{
			return 0;
		}
 public BuiltinType( CorDebugAssembly assembly, uint tkCLR, CorDebugClass cls )
 {
     this.m_assembly = assembly;
     this.m_tkCLR = tkCLR;
     this.m_class = cls;
 }
 public CorDebugFunction (CorDebugClass cls, uint tkSymbolless) : this (cls, null)
 {
     m_tkSymbolless = tkSymbolless;
 }
			public ManagedCallbackClass (CorDebugClass c, EventType eventType)
			{
				m_class = c;
				m_eventType = eventType;
			}