Exemple #1
0
 public CorValue GetStaticFieldValue(int fieldToken, CorFrame managedFrame)
 {
     ICorDebugValue pValue;
     m_class.GetStaticFieldValue((uint) fieldToken, (managedFrame == null) ? null : managedFrame.m_frame,
                                 out pValue);
     return pValue == null ? null : new CorValue(pValue);
 }
Exemple #2
0
        public CorValue GetStaticFieldValue(int fieldToken, CorFrame frame)
        {
            ICorDebugValue dv = null;

            m_type.GetStaticFieldValue((uint)fieldToken, frame.m_frame, out dv);
            return(dv == null ? null : new CorValue(dv));
        }
        public CorValue GetStaticFieldValue(int fieldToken, CorFrame managedFrame)
        {
            ICorDebugValue pValue;

            m_class.GetStaticFieldValue((uint)fieldToken, (managedFrame == null) ? null : managedFrame.m_frame,
                                        out pValue);
            return(pValue == null ? null : new CorValue(pValue));
        }
Exemple #4
0
        //
        // IEnumerator interface
        //

        #region IEnumerator Members

        public bool MoveNext()
        {
            var  a = new ICorDebugFrame[1];
            uint c = 0;
            int  r = m_enum.Next((uint)a.Length, a, out c);

            if (r == 0 && c == 1) // S_OK && we got 1 new element
            {
                m_frame = new CorFrame(a[0]);
            }
            else
            {
                m_frame = null;
            }
            return(m_frame != null);
        }
Exemple #5
0
        private void AddLocalVariablesToList(CorFrame frame, int ip, ArrayList listToAdd, ISymbolScope scope)
        {
            Debug.Assert(frame.FunctionToken == m_function.Token);

            foreach (ISymbolVariable isv in scope.GetLocals())
            {
                Debug.Assert(isv.AddressKind == SymAddressKind.ILOffset);
                CorValue v = null;
                try
                {
                    v = frame.GetLocalVariable(isv.AddressField1);
                }
                catch (COMException e)
                {
                    if (e.ErrorCode != (int) HResult.CORDBG_E_IL_VAR_NOT_AVAILABLE)
                        throw;
                }

                listToAdd.Add(new MDbgValue(m_module.Process, isv.Name, v));
            }

            foreach (ISymbolScope s in scope.GetChildren())
            {
                if (s.StartOffset <= ip && s.EndOffset >= ip)
                    AddLocalVariablesToList(frame, ip, listToAdd, s);
            }
        }
Exemple #6
0
        /// <summary>
        /// Gets the MDbgSourcePosition from a given CorFrame.
        /// </summary>
        /// <param name="frame">The CorFrame.</param>
        /// <returns>The MDbgSourcePosition of the given frame.</returns>
        public MDbgSourcePosition GetSourcePositionFromFrame(CorFrame frame)
        {
            // EnsureIsUpToDate is called from GetSourcePositionFromIP

            // we only support this, when the frame is our function
            Debug.Assert(frame.FunctionToken == m_function.Token);

            uint ip;
            CorDebugMappingResult mappingResult;
            frame.GetIP(out ip, out mappingResult);

            // MAPPING_APPROXIMATE, MAPPING_EXACT, MAPPING_PROLOG, or MAPPING_EPILOG are all ok and we should show sources.
            // But these two indicate that something went wrong and nothing is available.
            if (mappingResult == CorDebugMappingResult.MAPPING_NO_INFO ||
                mappingResult == CorDebugMappingResult.MAPPING_UNMAPPED_ADDRESS)
                return null;

            return GetSourcePositionFromIP((int) ip);
        }
Exemple #7
0
 public CorValue GetStaticFieldValue(int fieldToken, CorFrame frame)
 {
     ICorDebugValue dv = null;
     m_type.GetStaticFieldValue((uint) fieldToken, frame.m_frame, out dv);
     return dv == null ? null : new CorValue(dv);
 }
 public void Reset()
 {
     m_enum.Reset();
     m_frame = null;
 }
        //
        // IEnumerator interface
        //

        #region IEnumerator Members

        public bool MoveNext()
        {
            var a = new ICorDebugFrame[1];
            uint c = 0;
            int r = m_enum.Next((uint) a.Length, a, out c);
            if (r == 0 && c == 1) // S_OK && we got 1 new element
                m_frame = new CorFrame(a[0]);
            else
                m_frame = null;
            return m_frame != null;
        }
        /** 
         * Intercept the current exception.
         */

        public void InterceptCurrentException(CorFrame frame)
        {
            var m_th2 = (ICorDebugThread2) m_th;
            m_th2.InterceptCurrentException(frame.m_frame);
        }
Exemple #11
0
 internal MDbgILFrame(MDbgThread thread, CorFrame frame)
     : base(thread)
 {
     Debug.Assert(frame != null);
     m_frame = frame;
 }
 public CorException2EventArgs(CorAppDomain appDomain,
                               CorThread thread,
                               CorFrame frame,
                               int offset,
                               CorDebugExceptionCallbackType eventType,
                               int flags,
                               ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_frame = frame;
     m_offset = offset;
     m_eventType = eventType;
     m_flags = flags;
 }
Exemple #13
0
 public void Reset()
 {
     m_enum.Reset();
     m_frame = null;
 }
Exemple #14
0
        /**
         * Intercept the current exception.
         */

        public void InterceptCurrentException(CorFrame frame)
        {
            var m_th2 = (ICorDebugThread2)m_th;

            m_th2.InterceptCurrentException(frame.m_frame);
        }