Esempio n. 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;
		}
Esempio n. 2
0
 public CorDebugEval (CorDebugThread thread) 
 {
     m_appDomain = thread.Chain.ActiveFrame.AppDomain;
     m_threadReal = thread;
     m_resultType = EvalResult.NotFinished;
     ResetScratchPadLocation ();            
 }
Esempio n. 3
0
        int Microsoft.VisualStudio.Debugger.Interop.IDebugPortEx2.GetProgram(IDebugProgramNode2 pProgramNode, out IDebugProgram2 ppProgram)
        {
            CorDebugAppDomain appDomain = GetAppDomain(pProgramNode);

            ppProgram = appDomain;

            return(Utility.COM_HResults.S_OK);
        }
Esempio n. 4
0
		public static CorDebugValue[] CreateValues (RuntimeValue[] rtv, CorDebugAppDomain appDomain)
		{
			CorDebugValue[] values = new CorDebugValue[rtv.Length];
			for (int i = 0; i < rtv.Length; i++) {
				values [i] = CorDebugValue.CreateValue (rtv [i], appDomain);
			}

			return values;
		}
Esempio n. 5
0
        public CorDebugAssembly CreateAssemblyInstance(CorDebugAppDomain appDomain)
        {
            CorDebugAssembly assm = (CorDebugAssembly)MemberwiseClone();

            assm.m_appDomain       = appDomain;
            assm.m_primaryAssembly = this;

            return(assm);
        }
Esempio n. 6
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;
     }
 }
Esempio n. 7
0
        public static CorDebugValue[] CreateValues(RuntimeValue[] rtv, CorDebugAppDomain appDomain)
        {
            CorDebugValue[] values = new CorDebugValue[rtv.Length];
            for (int i = 0; i < rtv.Length; i++)
            {
                values [i] = CorDebugValue.CreateValue(rtv [i], appDomain);
            }

            return(values);
        }
        protected CorDebugBreakpointBase(CorDebugProcess process)
        {
            m_breakpointDef       = new BreakpointDef();
            m_breakpointDef.m_id  = s_idNext++;
            m_breakpointDef.m_pid = BreakpointDef.c_PID_ANY;

            m_appDomain = null;
            m_process   = process;

            Debug.Assert(s_idNext != s_idNull);
        }
        protected CorDebugBreakpointBase( CorDebugProcess process )
        {                        
            m_breakpointDef = new BreakpointDef();
            m_breakpointDef.m_id = s_idNext++;
            m_breakpointDef.m_pid = BreakpointDef.c_PID_ANY;

            m_appDomain = null;
            m_process = process;

            Debug.Assert(s_idNext != s_idNull);
        }
Esempio n. 10
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;        
        }
Esempio n. 11
0
        private void SendProgramEvent(IDebugProgramNode2 programNode, enum_EVENTATTRIBUTES attributes, Guid iidEvent)
        {
            CorDebugProcess   process   = GetProcess(programNode);
            CorDebugAppDomain appDomain = GetAppDomain(programNode);

            IDebugEvent2 evt = new DebugEvent((uint)attributes);

            foreach (IDebugPortEvents2 dpe in m_cpDebugPortEvents2.Sinks)
            {
                dpe.Event(this.DebugPortSupplier.CoreServer, this, (IDebugProcess2)process, (IDebugProgram2)appDomain, evt, ref iidEvent);
            }
        }
Esempio n. 12
0
        public CorDebugAssembly CreateAssemblyInstance(CorDebugAppDomain appDomain)
        {
            //Ensure the metadata import is created.
            IMetaDataImport iMetaDataImport = this.MetaDataImport;

            CorDebugAssembly assm = (CorDebugAssembly)MemberwiseClone();

            assm.m_appDomain       = appDomain;
            assm.m_primaryAssembly = this;

            return(assm);
        }
Esempio n. 13
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);
        }
Esempio n. 14
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);
        }
Esempio n. 15
0
        private CorDebugAppDomain GetAppDomain(IDebugProgramNode2 programNode)
        {
            uint appDomainId;

            CorDebugProcess process = GetProcess(programNode);

            IDebugCOMPlusProgramNode2 node = (IDebugCOMPlusProgramNode2)programNode;

            node.GetAppDomainId(out appDomainId);

            CorDebugAppDomain appDomain = process.GetAppDomainFromId(appDomainId);

            return(appDomain);
        }
Esempio n. 16
0
            public override void Dispatch(ICorDebugManagedCallback callback)
            {
                CorDebugAppDomain appDomain = m_class.Assembly.AppDomain;

                switch (m_eventType)
                {
                case EventType.LoadClass:
                    callback.LoadClass(appDomain, m_class);
                    break;

                case EventType.UnloadClass:
                    callback.UnloadClass(appDomain, m_class);
                    break;
                }
            }
Esempio n. 17
0
 public static CorDebugAssembly AssemblyFromIndex(CorDebugAppDomain appDomain, uint index)
 {
     return(appDomain.AssemblyFromIdx(TinyCLR_TypeSystem.IdxAssemblyFromIndex(index)));
 }
 protected CorDebugBreakpointBase(CorDebugAppDomain appDomain) : this(appDomain.Process)
 {
     m_appDomain = appDomain;
 }
            public CorDebugValue GetValue(int index, CorDebugAppDomain appDomain)
            {
                WeakReference wr = m_scratchPad[index];

                if (wr == null)
                {
                    wr = new WeakReference(null);
                    m_scratchPad[index] = wr;
                }

                CorDebugValue val = (CorDebugValue) wr.Target;

                if (val == null)
                {
                    val = CorDebugValue.CreateValue(m_process.Engine.GetScratchPadValue(index), appDomain);
                    wr.Target = val;
                }

                return val;
            }
Esempio n. 20
0
		public CorDebugValueReferenceByRef (CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base (val, rtv, appDomain)
		{                    
		}
Esempio n. 21
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;                
			}
		}
        internal ArrayList GetBreakpoints( Type t, CorDebugAppDomain appDomain )
        {
            ArrayList al = new ArrayList( m_breakpoints.Count );

            foreach(CorDebugBreakpointBase breakpoint in m_breakpoints)
            {
                if(t.IsAssignableFrom( breakpoint.GetType() ))
                {
                    if(appDomain == null || appDomain == breakpoint.AppDomain)
                    {
                        al.Add( breakpoint );
                    }
                }
            }

            return al;
        }
Esempio n. 23
0
		public CorDebugValueBoxedObject (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
			m_value = new CorDebugValueObject (rtv, appDomain);  
		}
Esempio n. 24
0
 public CorDebugValueReferenceByRef(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base(val, rtv, appDomain)
 {
 }
Esempio n. 25
0
 public CorDebugValueArray(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
Esempio n. 26
0
 public CorDebugValueBoxedObject(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
     m_value = new CorDebugValueObject(rtv, appDomain);
 }
Esempio n. 27
0
 public CorDebugValueReference(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
     m_value = val;
 }
Esempio n. 28
0
 public CorDebugValuePrimitive(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
 private void RemoveAppDomain(CorDebugAppDomain appDomain)
 {
     EnqueueEvent(new ManagedCallbacks.ManagedCallbackAppDomain(appDomain, ManagedCallbacks.ManagedCallbackAppDomain.EventType.ExitAppDomain));
     m_appDomains.Remove(appDomain);
 }
Esempio n. 30
0
 public CorDebugValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
            public CorDebugClass GetClass( CorDebugAppDomain appDomain )
            {
                CorDebugAssembly assembly = GetAssembly( appDomain );

                return assembly.GetClassFromTokenCLR( this.m_tkCLR );
            }
Esempio n. 32
0
        public CorDebugAssembly(CorDebugProcess process, string name, Pdbx.PdbxFile pdbxFile, uint idx)
        {
            m_process              = process;
            m_appDomain            = null;
            m_name                 = name;
            m_pdbxFile             = pdbxFile;
            m_pdbxAssembly         = (pdbxFile != null) ? pdbxFile.Assembly : null;
            m_htTokenCLRToPdbx     = new Hashtable();
            m_htTokenTinyCLRToPdbx = new Hashtable();
            m_idx                 = idx;
            m_primaryAssembly     = null;
            m_isFrameworkAssembly = false;

            if (m_pdbxAssembly != null)
            {
                if (!string.IsNullOrEmpty(pdbxFile.PdbxPath))
                {
                    string pth = pdbxFile.PdbxPath.ToLower();

                    if (pth.Contains(@"\buildoutput\"))
                    {
                        #region V4_1_FRAMEWORK_ASSEMBLIES
                        List <string> frameworkAssemblies = new List <string> {
                            "mfdpwsclient",
                            "mfdpwsdevice",
                            "mfdpwsextensions",
                            "mfwsstack",
                            "microsoft.spot.graphics",
                            "microsoft.spot.hardware",
                            "microsoft.spot.hardware.serialport",
                            "microsoft.spot.hardware.usb",
                            "microsoft.spot.ink",
                            "microsoft.spot.io",
                            "microsoft.spot.native",
                            "microsoft.spot.net",
                            "microsoft.spot.net.security",
                            "microsoft.spot.time",
                            "microsoft.spot.tinycore",
                            "microsoft.spot.touch",
                            "mscorlib",
                            "system.http",
                            "system.io",
                            "system.net.security",
                            "system",
                            "system.xml.legacy",
                            "system.xml",
                        };
                        #endregion // V4_1_FRAMEWORK_ASSEMBLIES

                        m_isFrameworkAssembly = (frameworkAssemblies.Contains(name.ToLower()));
                    }
                    else
                    {
                        m_isFrameworkAssembly = pdbxFile.PdbxPath.ToLower().Contains(@"\microsoft .net micro framework\");
                    }
                }

                m_pdbxAssembly.CorDebugAssembly = this;
                foreach (Pdbx.Class c in m_pdbxAssembly.Classes)
                {
                    AddTokenToHashtables(c.Token, c);
                    foreach (Pdbx.Field field in c.Fields)
                    {
                        AddTokenToHashtables(field.Token, field);
                    }

                    foreach (Pdbx.Method method in c.Methods)
                    {
                        AddTokenToHashtables(method.Token, method);
                    }
                }
            }
        }
        public void SetCurrentAppDomain( CorDebugAppDomain appDomain )
        {
            if(appDomain != m_appDomainCurrent)
            {
                if(appDomain != null && this.Engine.Capabilities.AppDomains)
                {
                    this.Engine.SetCurrentAppDomain( appDomain.Id );
                }
            }

            m_appDomainCurrent = appDomain;
        }
Esempio n. 34
0
 public CorDebugValueString(RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
 }
Esempio n. 35
0
		public CorDebugValuePrimitive (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
		}
		public static CorDebugAssembly AssemblyFromIndex (CorDebugAppDomain appDomain, uint index)
		{
			return appDomain.AssemblyFromIdx (TinyCLR_TypeSystem.IdxAssemblyFromIndex (index));
		}
Esempio n. 37
0
		public CorDebugValueReference (CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain)
            : base (rtv, appDomain)
		{
			m_value = val;
		}
 public ManagedCallbackAppDomain(CorDebugAppDomain appDomain, EventType eventType)
 {
     m_appDomain = appDomain;
     m_eventType = eventType;
 }
Esempio n. 39
0
		public CorDebugValueArray (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
		}
Esempio n. 40
0
		public CorDebugValue (RuntimeValue rtv, CorDebugAppDomain appDomain)
		{
			m_rtv = rtv;                                  
			m_appDomain = appDomain;
		}
Esempio n. 41
0
		public CorDebugValueString (RuntimeValue rtv, CorDebugAppDomain appDomain)
            : base (rtv, appDomain)
		{
		}
Esempio n. 42
0
			public ManagedCallbackAppDomain (CorDebugAppDomain appDomain, EventType eventType)
			{
				m_appDomain = appDomain;
				m_eventType = eventType;
			}
Esempio n. 43
0
        public CorDebugAssembly(CorDebugProcess process, string name, Pdbx.PdbxFile pdbxFile, uint idx)
        {
            m_process              = process;
            m_appDomain            = null;
            m_name                 = name;
            m_pdbxFile             = pdbxFile;
            m_pdbxAssembly         = (pdbxFile != null) ? pdbxFile.Assembly : null;
            m_htTokenCLRToPdbx     = new Hashtable();
            m_htTokenTinyCLRToPdbx = new Hashtable();
            m_idx                 = idx;
            m_primaryAssembly     = null;
            m_isFrameworkAssembly = false;

            if (m_pdbxAssembly != null)
            {
                if (!string.IsNullOrEmpty(pdbxFile.PdbxPath))
                {
                    string pth = pdbxFile.PdbxPath.ToLower();

                    if (pth.Contains(Path.DirectorySeparatorChar + "buildoutput" + Path.DirectorySeparatorChar))
                    {
                        #region V4_1_FRAMEWORK_ASSEMBLIES
                        List <string> frameworkAssemblies = new List <string> {
                            "mfdpwsclient",
                            "mfdpwsdevice",
                            "mfdpwsextensions",
                            "mfwsstack",
                            "microsoft.spot.graphics",
                            "microsoft.spot.hardware",
                            "microsoft.spot.hardware.serialport",
                            "microsoft.spot.hardware.usb",
                            "microsoft.spot.ink",
                            "microsoft.spot.io",
                            "microsoft.spot.native",
                            "microsoft.spot.net",
                            "microsoft.spot.net.security",
                            "microsoft.spot.time",
                            "microsoft.spot.tinycore",
                            "microsoft.spot.touch",
                            "mscorlib",
                            "system.http",
                            "system.io",
                            "system.net.security",
                            "system",
                            "system.xml.legacy",
                            "system.xml",
                        };
                        #endregion // V4_1_FRAMEWORK_ASSEMBLIES

                        m_isFrameworkAssembly = (frameworkAssemblies.Contains(name.ToLower()));
                    }
                    else
                    {
                        m_isFrameworkAssembly = pdbxFile.PdbxPath.ToLower().Contains(Path.PathSeparator + ".net micro framework" + Path.PathSeparator);
                    }
                }

                m_pdbxAssembly.CorDebugAssembly = this;
                foreach (Pdbx.Class c in m_pdbxAssembly.Classes)
                {
                    AddTokenToHashtables(c.Token, c);
                    foreach (Pdbx.Field field in c.Fields)
                    {
                        AddTokenToHashtables(field.Token, field);
                    }

                    foreach (Pdbx.Method method in c.Methods)
                    {
                        AddTokenToHashtables(method.Token, method);
                    }
                }

                if (File.Exists(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".dll")))
                {
                    MetaData = ModuleDefinition.ReadModule(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".dll"));
                }
                else if (File.Exists(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".exe")))
                {
                    MetaData = ModuleDefinition.ReadModule(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".exe"));
                }

                if (MetaData != null && File.Exists(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".exe.mdb")))
                {
                    DebugData = new Mono.Cecil.Mdb.MdbReaderProvider().GetSymbolReader(MetaData, Path.ChangeExtension(m_pdbxFile.PdbxPath, ".exe"));
                    MetaData.ReadSymbols(DebugData);
                }
                else if (MetaData != null && File.Exists(Path.ChangeExtension(m_pdbxFile.PdbxPath, ".dll.mdb")))
                {
                    DebugData = new Mono.Cecil.Mdb.MdbReaderProvider().GetSymbolReader(MetaData, Path.ChangeExtension(m_pdbxFile.PdbxPath, ".dll"));
                    MetaData.ReadSymbols(DebugData);
                }
            }
        }
        private void EnqueueStartupEventsAndWait()
        {
            DebugAssert(m_pid != 0);    //cpde will fail
            DebugAssert(m_portDefinition != null);

            EnqueueEvent(new ManagedCallbacks.ManagedCallbackProcess(this, ManagedCallbacks.ManagedCallbackProcess.EventType.CreateProcess));

            CorDebugAppDomain appDomain = new CorDebugAppDomain(this, 1);
            m_appDomains.Add(appDomain);

            EnqueueEvent(new ManagedCallbacks.ManagedCallbackAppDomain(appDomain, ManagedCallbacks.ManagedCallbackAppDomain.EventType.CreateAppDomain));

            if (m_fLaunched)
            {
                //the sdm tries to resumeProcess through the DE, but cpde doesn't propagate that message to our
                //Debug Port.  As a result, we have to create a dummy thread, just so that cpde can resume it.
                //We wait for initialization to be complete, by getting signaled by the dummy thread.
                VsPackage.MessageCentre.InternalErrorMsg(false, DiagnosticStrings.WaitingForWakeup);
                WaitDummyThread();
            }

            //Dispatch the CreateProcess/CreateAppDomain events, so that VS will hopefully shut down nicely from now on
            FlushEvents();

            DebugAssert(m_cStopped == 0);
            DebugAssert(!AnyQueuedEvents);
        }
Esempio n. 45
0
			public ManagedCallbackDebugMessage (CorDebugThread thread, CorDebugAppDomain appDomain, string switchName, string message, LoggingLevelEnum level) : base (thread)
			{
				m_switchName = switchName;
				m_message = message;
				m_level = level;
				m_appDomain = appDomain;
			}
 protected CorDebugBreakpointBase(CorDebugAppDomain appDomain) : this(appDomain.Process)
 {
     m_appDomain = appDomain;
 }
Esempio n. 47
0
        public static CorDebugFunction CorDebugFunctionFromMethodIndex(uint methodIndex, CorDebugAppDomain appDomain)
        {
            CorDebugFunction function = null;
            CorDebugAssembly assembly = appDomain.AssemblyFromIdx(TinyCLR_TypeSystem.IdxAssemblyFromIndex(methodIndex));

            if (assembly != null)
            {
                uint tk = TinyCLR_TypeSystem.TinyCLRTokenFromMethodIndex(methodIndex);
                function = assembly.GetFunctionFromTokenTinyCLR(tk);
            }

            return(function);
        }
        private void CreateAppDomainFromId(uint id)
        {
            CorDebugAppDomain appDomain = new CorDebugAppDomain(this, id);

            m_appDomains.Add(appDomain);
            EnqueueEvent(new ManagedCallbacks.ManagedCallbackAppDomain(appDomain, ManagedCallbacks.ManagedCallbackAppDomain.EventType.CreateAppDomain));
        }
Esempio n. 49
0
 public CorDebugBreakpoint(CorDebugAppDomain appDomain) : base(appDomain)
 {
     this.Kind = BreakpointDef.c_HARD;
 }
 public CorDebugAssembly GetAssembly( CorDebugAppDomain appDomain )
 {
     return appDomain.AssemblyFromIdx( m_assembly.Idx );
 }
Esempio n. 51
0
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_elemType  = elemType;
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
        public CorDebugAssembly( CorDebugProcess process, string name, Pdbx.PdbxFile pdbxFile, uint idx )
        {
            m_process = process;
            m_appDomain = null;
            m_name = name;
            m_pdbxFile = pdbxFile;
            m_pdbxAssembly = (pdbxFile != null) ? pdbxFile.Assembly : null;
            m_htTokenCLRToPdbx = new Hashtable();
            m_htTokenTinyCLRToPdbx = new Hashtable();
            m_idx = idx;
            m_primaryAssembly = null;
            m_isFrameworkAssembly = false;

            if(m_pdbxAssembly != null)
            {
                if (!string.IsNullOrEmpty(pdbxFile.PdbxPath))
                {
                    string pth = pdbxFile.PdbxPath.ToLower();

                    if (pth.Contains(@"\buildoutput\"))
                    {
#region V4_1_FRAMEWORK_ASSEMBLIES
                        List<string> frameworkAssemblies = new List<string> {
                                "mfdpwsclient",
                                "mfdpwsdevice",
                                "mfdpwsextensions",
                                "mfwsstack",
                                "microsoft.spot.graphics",
                                "microsoft.spot.hardware",
                                "microsoft.spot.hardware.serialport",
                                "microsoft.spot.hardware.usb",
                                "microsoft.spot.ink",
                                "microsoft.spot.io",
                                "microsoft.spot.native",
                                "microsoft.spot.net",
                                "microsoft.spot.net.security",
                                "microsoft.spot.time",
                                "microsoft.spot.tinycore",
                                "microsoft.spot.touch",
                                "mscorlib",
                                "system.http",
                                "system.io",
                                "system.net.security",
                                "system",
                                "system.xml.legacy",
                                "system.xml", 
                                                             };
#endregion // V4_1_FRAMEWORK_ASSEMBLIES

                        m_isFrameworkAssembly = (frameworkAssemblies.Contains(name.ToLower()));
                    }
                    else
                    {
                        m_isFrameworkAssembly = pdbxFile.PdbxPath.ToLower().Contains(@"\microsoft .net micro framework\");
                    }
                }

                m_pdbxAssembly.CorDebugAssembly = this;
                foreach(Pdbx.Class c in m_pdbxAssembly.Classes)
                {
                    AddTokenToHashtables( c.Token, c );
                    foreach(Pdbx.Field field in c.Fields)
                    {
                        AddTokenToHashtables( field.Token, field );
                    }

                    foreach(Pdbx.Method method in c.Methods)
                    {
                        AddTokenToHashtables( method.Token, method );
                    }
                }
            }
        }
		public static CorDebugFunction CorDebugFunctionFromMethodIndex (uint methodIndex, CorDebugAppDomain appDomain)
		{
			CorDebugFunction function = null;
			CorDebugAssembly assembly = appDomain.AssemblyFromIdx (TinyCLR_TypeSystem.IdxAssemblyFromIndex (methodIndex));

			if (assembly != null) {
				uint tk = TinyCLR_TypeSystem.TinyCLRTokenFromMethodIndex (methodIndex);
				function = assembly.GetFunctionFromTokenTinyCLR (tk);                
			}

			return function;
		}
Esempio n. 54
0
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 { 
     m_elemType = elemType;
     m_rtv = rtv;
     m_appDomain = appDomain; 
 }
		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;
		}
        public CorDebugAssembly CreateAssemblyInstance( CorDebugAppDomain appDomain )
        {
            //Ensure the metadata import is created.  
            IMetaDataImport iMetaDataImport = this.MetaDataImport;

            CorDebugAssembly assm = (CorDebugAssembly)MemberwiseClone();
            assm.m_appDomain = appDomain;
            assm.m_primaryAssembly = this;

            return assm;
        }