Exemplo 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;
		}
Exemplo n.º 2
0
 public CorDebugEval (CorDebugThread thread) 
 {
     m_appDomain = thread.Chain.ActiveFrame.AppDomain;
     m_threadReal = thread;
     m_resultType = EvalResult.NotFinished;
     ResetScratchPadLocation ();            
 }
Exemplo 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);
        }
Exemplo 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;
		}
Exemplo n.º 5
0
        public CorDebugAssembly CreateAssemblyInstance(CorDebugAppDomain appDomain)
        {
            CorDebugAssembly assm = (CorDebugAssembly)MemberwiseClone();

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

            return(assm);
        }
Exemplo 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;
     }
 }
Exemplo 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);
        }
Exemplo 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;        
        }
Exemplo 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);
            }
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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;
                }
            }
Exemplo 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;
 }
Exemplo n.º 19
0
            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;
            }
Exemplo n.º 20
0
		public CorDebugValueReferenceByRef (CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base (val, rtv, appDomain)
		{                    
		}
Exemplo 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;                
			}
		}
Exemplo n.º 22
0
        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;
        }
Exemplo n.º 23
0
		public CorDebugValueBoxedObject (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
			m_value = new CorDebugValueObject (rtv, appDomain);  
		}
Exemplo n.º 24
0
 public CorDebugValueReferenceByRef(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base(val, rtv, appDomain)
 {
 }
Exemplo n.º 25
0
 public CorDebugValueArray(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
Exemplo n.º 26
0
 public CorDebugValueBoxedObject(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
     m_value = new CorDebugValueObject(rtv, appDomain);
 }
Exemplo n.º 27
0
 public CorDebugValueReference(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
     m_value = val;
 }
Exemplo n.º 28
0
 public CorDebugValuePrimitive(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
Exemplo n.º 29
0
 private void RemoveAppDomain(CorDebugAppDomain appDomain)
 {
     EnqueueEvent(new ManagedCallbacks.ManagedCallbackAppDomain(appDomain, ManagedCallbacks.ManagedCallbackAppDomain.EventType.ExitAppDomain));
     m_appDomains.Remove(appDomain);
 }
Exemplo n.º 30
0
 public CorDebugValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
Exemplo n.º 31
0
            public CorDebugClass GetClass( CorDebugAppDomain appDomain )
            {
                CorDebugAssembly assembly = GetAssembly( appDomain );

                return assembly.GetClassFromTokenCLR( this.m_tkCLR );
            }
Exemplo 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);
                    }
                }
            }
        }
Exemplo n.º 33
0
        public void SetCurrentAppDomain( CorDebugAppDomain appDomain )
        {
            if(appDomain != m_appDomainCurrent)
            {
                if(appDomain != null && this.Engine.Capabilities.AppDomains)
                {
                    this.Engine.SetCurrentAppDomain( appDomain.Id );
                }
            }

            m_appDomainCurrent = appDomain;
        }
Exemplo n.º 34
0
 public CorDebugValueString(RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
 }
Exemplo n.º 35
0
		public CorDebugValuePrimitive (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
		}
Exemplo n.º 36
0
		public static CorDebugAssembly AssemblyFromIndex (CorDebugAppDomain appDomain, uint index)
		{
			return appDomain.AssemblyFromIdx (TinyCLR_TypeSystem.IdxAssemblyFromIndex (index));
		}
Exemplo 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;
 }
Exemplo n.º 39
0
		public CorDebugValueArray (RuntimeValue rtv, CorDebugAppDomain appDomain) : base (rtv, appDomain)
		{
		}
Exemplo n.º 40
0
		public CorDebugValue (RuntimeValue rtv, CorDebugAppDomain appDomain)
		{
			m_rtv = rtv;                                  
			m_appDomain = appDomain;
		}
Exemplo n.º 41
0
		public CorDebugValueString (RuntimeValue rtv, CorDebugAppDomain appDomain)
            : base (rtv, appDomain)
		{
		}
Exemplo n.º 42
0
			public ManagedCallbackAppDomain (CorDebugAppDomain appDomain, EventType eventType)
			{
				m_appDomain = appDomain;
				m_eventType = eventType;
			}
Exemplo 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);
                }
            }
        }
Exemplo n.º 44
0
        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);
        }
Exemplo 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;
 }
Exemplo 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);
        }
Exemplo n.º 48
0
        private void CreateAppDomainFromId(uint id)
        {
            CorDebugAppDomain appDomain = new CorDebugAppDomain(this, id);

            m_appDomains.Add(appDomain);
            EnqueueEvent(new ManagedCallbacks.ManagedCallbackAppDomain(appDomain, ManagedCallbacks.ManagedCallbackAppDomain.EventType.CreateAppDomain));
        }
Exemplo n.º 49
0
 public CorDebugBreakpoint(CorDebugAppDomain appDomain) : base(appDomain)
 {
     this.Kind = BreakpointDef.c_HARD;
 }
Exemplo n.º 50
0
 public CorDebugAssembly GetAssembly( CorDebugAppDomain appDomain )
 {
     return appDomain.AssemblyFromIdx( m_assembly.Idx );
 }
Exemplo n.º 51
0
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_elemType  = elemType;
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
Exemplo n.º 52
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 );
                    }
                }
            }
        }
Exemplo n.º 53
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;
		}
Exemplo n.º 54
0
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 { 
     m_elemType = elemType;
     m_rtv = rtv;
     m_appDomain = appDomain; 
 }
Exemplo n.º 55
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;
		}
Exemplo n.º 56
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;
        }