Ejemplo n.º 1
0
        public void EmitDebugVar(DebugVarInfo debugVar)
        {
            int  rangeCount = debugVar.Ranges.Count;
            uint typeIndex  = GetVariableTypeIndex(debugVar.Type, true);

            EmitDebugVar(_nativeObjectWriter, debugVar.Name, typeIndex, debugVar.IsParam, rangeCount, debugVar.Ranges.ToArray());
        }
Ejemplo n.º 2
0
        public void EmitDebugVar(DebugVarInfo debugVar)
        {
            int  rangeCount = debugVar.Ranges.Count;
            uint typeIndex;

            try
            {
                typeIndex = _userDefinedTypeDescriptor.GetVariableTypeIndex(debugVar.Type);
            }
            catch (TypeSystemException)
            {
                typeIndex = 0; // T_NOTYPE
            }

            EmitDebugVar(_nativeObjectWriter, debugVar.Name, typeIndex, debugVar.IsParam, rangeCount, debugVar.Ranges.ToArray());
        }
Ejemplo n.º 3
0
 public void EmitDebugVar(DebugVarInfo debugVar)
 {
     int rangeCount = debugVar.Ranges.Count;
     EmitDebugVar(_nativeObjectWriter, debugVar.Name, debugVar.TypeIndex, debugVar.IsParam, rangeCount, debugVar.Ranges.ToArray());
 }
Ejemplo n.º 4
0
        public void EmitDebugVar(DebugVarInfo debugVar)
        {
            int rangeCount = debugVar.Ranges.Count;

            EmitDebugVar(_nativeObjectWriter, debugVar.Name, debugVar.TypeIndex, debugVar.IsParam, rangeCount, debugVar.Ranges.ToArray());
        }
Ejemplo n.º 5
0
 public void InitializeDebugVarInfos(DebugVarInfo[] debugVarInfos)
 {
     Debug.Assert(_debugVarInfos == null);
     _debugVarInfos = debugVarInfos;
 }
Ejemplo n.º 6
0
        private void updateDebugVarInfo(Dictionary<uint, DebugVarInfo> debugVars, string name,
                                        bool isParam, NativeVarInfo nativeVarInfo)
        {
            DebugVarInfo debugVar;

            if (!debugVars.TryGetValue(nativeVarInfo.varNumber, out debugVar))
            {
                // TODO: Force an INT32 type (0x0074 in CodeView) for now. Fix it later.
                // ISSUE #784. 
                debugVar = new DebugVarInfo(name, isParam, typeIndex : 0x0074);
                debugVars[nativeVarInfo.varNumber] = debugVar;
            }

            debugVar.Ranges.Add(nativeVarInfo);
        }
Ejemplo n.º 7
0
        private void setVars(CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars)
        {
            if (_localSlotToInfoMap == null && _parameterIndexToNameMap == null)
            {
                return;
            }

            uint paramCount = (_parameterIndexToNameMap == null) ? 0 : (uint)_parameterIndexToNameMap.Count;
            Dictionary<uint, DebugVarInfo> debugVars = new Dictionary<uint, DebugVarInfo>();
            int i;

            for (i = 0; i < cVars; i++)
            {
                NativeVarInfo nativeVarInfo = vars[i];

                if (nativeVarInfo.varNumber < paramCount)
                {
                    string name = _parameterIndexToNameMap[nativeVarInfo.varNumber];
                    updateDebugVarInfo(debugVars, name, true, nativeVarInfo);
                }
                else if (_localSlotToInfoMap != null)
                {
                    ILLocalVariable ilVar;
                    uint slotNumber = nativeVarInfo.varNumber - paramCount;
                    if (_localSlotToInfoMap.TryGetValue(slotNumber, out ilVar))
                    {
                        updateDebugVarInfo(debugVars, ilVar.Name, false, nativeVarInfo);
                    }
                }
            }

            i = 0;
            _debugVarInfos = new DebugVarInfo[debugVars.Count];
            foreach (var debugVar in debugVars)
            {
                _debugVarInfos[i] = debugVar.Value;
                i++;
            }
        }