示例#1
0
        int Microsoft.VisualStudio.Debugger.Interop.IDebugPortEx2.GetProgram(IDebugProgramNode2 pProgramNode, out IDebugProgram2 ppProgram)
        {
            CorDebugAppDomain appDomain = GetAppDomain(pProgramNode);

            ppProgram = appDomain;

            return(COM_HResults.S_OK);
        }
示例#2
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;
     }
 }
示例#3
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);
        }
示例#5
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);
        }
示例#6
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 _cpDebugPortEvents2.Sinks)
            {
                dpe.Event(this.DebugPortSupplier.CoreServer, this, (IDebugProcess2)process, (IDebugProgram2)appDomain, evt, ref iidEvent);
            }
        }
示例#7
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);
        }
示例#8
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);
        }
        public static CorDebugClass CorDebugClassFromTypeIndex(uint typeIndex, CorDebugAppDomain appDomain)
        {
            CorDebugClass cls = null;

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

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

            return(cls);
        }
示例#10
0
 public CorDebugValueReferenceByRef(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base(val, rtv, appDomain)
 {
 }
        public static CorDebugFunction CorDebugFunctionFromMethodIndex(uint methodIndex, CorDebugAppDomain appDomain)
        {
            CorDebugFunction function = null;
            CorDebugAssembly assembly = appDomain.AssemblyFromIdx(nanoCLR_TypeSystem.IdxAssemblyFromIndex(methodIndex));

            if (assembly != null)
            {
                uint tk = nanoCLR_TypeSystem.nanoCLRTokenFromMethodIndex(methodIndex);
                function = assembly.GetFunctionFromTokennanoCLR(tk);
            }

            return(function);
        }
示例#12
0
 public CorDebugValueReference(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
     m_value = val;
 }
示例#13
0
 public CorDebugValueBoxedObject(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
     m_value = new CorDebugValueObject(rtv, appDomain);
 }
示例#14
0
 public CorDebugValuePrimitive(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
示例#15
0
 public CorDebugValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
示例#16
0
 public CorDebugValueString(RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
 }
示例#17
0
 public ManagedCallbackAppDomain(CorDebugAppDomain appDomain, EventType eventType)
 {
     m_appDomain = appDomain;
     m_eventType = eventType;
 }
示例#18
0
 public CorDebugBreakpoint(CorDebugAppDomain appDomain) : base(appDomain)
 {
     this.Kind = BreakpointDef.c_HARD;
 }
示例#19
0
 public CorDebugValueArray(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
 public static CorDebugAssembly AssemblyFromIndex(CorDebugAppDomain appDomain, uint index)
 {
     return(appDomain.AssemblyFromIdx(nanoCLR_TypeSystem.IdxAssemblyFromIndex(index)));
 }
 protected CorDebugBreakpointBase(CorDebugAppDomain appDomain) : this(appDomain.Process)
 {
     m_appDomain = appDomain;
 }
示例#22
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_htTokennanoCLRToPdbx = 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);
                    }
                }
            }
        }
示例#23
0
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_elemType  = elemType;
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }