Пример #1
0
        public IEnumerable <RuntimeFrame> GetFrames()
        {
            ICorDebugFrameEnum frameEnum;

            _comChain.EnumerateFrames(out frameEnum);
            uint count;

            frameEnum.GetCount(out count);

            var framePtrs = new IntPtr[count];

            frameEnum.Next(count, framePtrs, out count);
            for (int i = 0; i < count; i++)
            {
                var frame        = Session.MtaStaConnector.MarshalAs <ICorDebugFrame>(framePtrs[i]);
                var frameWrapper = Session.ComInstanceCollector.GetWrapper <RuntimeFrame>(frame);
                if (frameWrapper == null)
                {
                    frameWrapper = new RuntimeFrame(Thread, frame);
                    Session.ComInstanceCollector.SetWrapper(frame, frameWrapper);
                }
                yield return(frameWrapper);
            }

            yield break;
        }
        public IEnumerable<RuntimeFrame> GetFrames()
        {
            ICorDebugFrameEnum frameEnum;
            _comChain.EnumerateFrames(out frameEnum);
            uint count;
            frameEnum.GetCount(out count);

            var framePtrs = new IntPtr[count];
       
            frameEnum.Next(count, framePtrs, out count);
            for (int i = 0; i < count;i++)
            {
                var frame = Session.MtaStaConnector.MarshalAs<ICorDebugFrame>(framePtrs[i]);
                var frameWrapper = Session.ComInstanceCollector.GetWrapper<RuntimeFrame>(frame);
                if (frameWrapper == null)
                {
                    frameWrapper = new RuntimeFrame(Thread, frame);
                    Session.ComInstanceCollector.SetWrapper(frame, frameWrapper);
                }
                yield return frameWrapper;
            }

            yield break;
        }