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._appDomain       = appDomain;
            assm._primaryAssembly = this;

            return(assm);
        }
예제 #6
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._rtv, val._appDomain);
            }

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

            return(val);
        }
        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(DebugPortSupplier.CoreServer, this, (IDebugProcess2)process, (IDebugProgram2)appDomain, evt, ref iidEvent);
            }
        }
예제 #8
0
        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);
        }
        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);
        }
예제 #10
0
        public CorDebugAssembly(CorDebugProcess process, string name, Pdbx.PdbxFile pdbxFile, uint idx)
        {
            _process              = process;
            _appDomain            = null;
            _name                 = name;
            _pdbxFile             = pdbxFile;
            _pdbxAssembly         = (pdbxFile != null) ? pdbxFile.Assembly : null;
            _htTokenCLRToPdbx     = new Hashtable();
            _htTokennanoCLRToPdbx = new Hashtable();
            _idx                 = idx;
            _primaryAssembly     = null;
            _isFrameworkAssembly = false;

            if (_pdbxAssembly != null)
            {
                if (!string.IsNullOrEmpty(pdbxFile.PdbxPath))
                {
                    string pdbxPath = pdbxFile.PdbxPath.ToLower();

                    // pdbx files are supposed to be in the 'packages' folder
                    if (pdbxPath.Contains(@"\packages\"))
                    {
                        _isFrameworkAssembly = (frameworkAssemblies_v1_0.Contains(name.ToLower()));
                    }
                }

                _pdbxAssembly.CorDebugAssembly = this;

                foreach (Pdbx.Class c in _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);
                    }
                }
            }
        }
예제 #11
0
 public CorDebugValueString(RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
 }
예제 #12
0
 public CorDebugValueArray(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
예제 #13
0
        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);
        }
예제 #14
0
 public CorDebugValueReferenceByRef(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain) : base(val, rtv, appDomain)
 {
 }
예제 #15
0
 public CorDebugValueReference(CorDebugValue val, RuntimeValue rtv, CorDebugAppDomain appDomain)
     : base(rtv, appDomain)
 {
     m_value = val;
 }
예제 #16
0
 public CorDebugValueBoxedObject(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
     m_value = new CorDebugValueObject(rtv, appDomain);
 }
예제 #17
0
 public CorDebugValuePrimitive(RuntimeValue rtv, CorDebugAppDomain appDomain) : base(rtv, appDomain)
 {
 }
 protected CorDebugBreakpointBase(CorDebugAppDomain appDomain) : this(appDomain.Process)
 {
     m_appDomain = appDomain;
 }
 // This is used to resolve values into types when we know the appdomain, but not the assembly.
 public CorDebugGenericType(CorElementType elemType, RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     m_elemType  = elemType;
     m_rtv       = rtv;
     m_appDomain = appDomain;
 }
 public ManagedCallbackAppDomain(CorDebugAppDomain appDomain, EventType eventType)
 {
     m_appDomain = appDomain;
     m_eventType = eventType;
 }
예제 #21
0
 public static CorDebugAssembly AssemblyFromIndex(CorDebugAppDomain appDomain, uint index)
 {
     return(appDomain.AssemblyFromIdx(nanoCLR_TypeSystem.IdxAssemblyFromIndex(index)));
 }
 public CorDebugBreakpoint(CorDebugAppDomain appDomain) : base(appDomain)
 {
     Kind = BreakpointDef.c_HARD;
 }
예제 #23
0
 public CorDebugValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
 {
     _rtv       = rtv;
     _appDomain = appDomain;
 }