コード例 #1
0
ファイル: V45Runtime.cs プロジェクト: snowdream1985/clrmd
        protected override DesktopStackFrame GetStackFrame(DesktopThread thread, byte[] context, ulong ip, ulong framePtr, ulong frameVtbl)
        {
            DesktopStackFrame frame;

            if (frameVtbl != 0)
            {
                ClrMethod innerMethod = null;
                string    frameName   = _sos.GetFrameName(frameVtbl);

                ulong md = _sos.GetMethodDescPtrFromFrame(framePtr);
                if (md != 0)
                {
                    V45MethodDescDataWrapper mdData = new V45MethodDescDataWrapper();
                    if (mdData.Init(_sos, md))
                    {
                        innerMethod = DesktopMethod.Create(this, mdData);
                    }
                }

                frame = new DesktopStackFrame(this, thread, context, framePtr, frameName, innerMethod);
            }
            else
            {
                frame = new DesktopStackFrame(this, thread, context, ip, framePtr, _sos.GetMethodDescPtrFromIP(ip));
            }

            return(frame);
        }
コード例 #2
0
ファイル: LegacyRuntime.cs プロジェクト: timhe/clrmd
        protected override DesktopStackFrame GetStackFrame(DesktopThread thread, byte[] context, ulong ip, ulong sp, ulong frameVtbl)
        {
            DesktopStackFrame frame;

            ClearBuffer();

            if (frameVtbl != 0)
            {
                ClrMethod method    = null;
                string    frameName = "Unknown Frame";
                if (Request(DacRequests.FRAME_NAME, frameVtbl, _buffer))
                {
                    frameName = BytesToString(_buffer);
                }

                IMethodDescData mdData = GetMethodDescData(DacRequests.METHODDESC_FRAME_DATA, sp);
                if (mdData != null)
                {
                    method = DesktopMethod.Create(this, mdData);
                }

                frame = new DesktopStackFrame(this, thread, context, sp, frameName, method);
            }
            else
            {
                ulong md = GetMethodDescFromIp(ip);
                frame = new DesktopStackFrame(this, thread, context, ip, sp, md);
            }

            return(frame);
        }
コード例 #3
0
        public override ClrMethod GetMethodByAddress(ulong ip)
        {
            IMethodDescData mdData = GetMDForIP(ip);

            if (mdData == null)
            {
                return(null);
            }

            return(DesktopMethod.Create(this, mdData));
        }
コード例 #4
0
ファイル: DesktopStackFrame.cs プロジェクト: anurse/clrmd
        private void InitMethod(ulong md)
        {
            if (_method != null)
            {
                return;
            }

            if (_ip != 0 && _type == ClrStackFrameType.ManagedMethod)
            {
                _method = _runtime.GetMethodByAddress(_ip);
            }
            else if (md != 0)
            {
                IMethodDescData mdData = _runtime.GetMethodDescData(md);
                _method = DesktopMethod.Create(_runtime, mdData);
            }
        }
コード例 #5
0
        internal void InitMethodHandles()
        {
            var runtime = DesktopHeap.DesktopRuntime;

            foreach (ulong methodTable in EnumerateMethodTables())
            {
                foreach (ulong methodDesc in runtime.GetMethodDescList(methodTable))
                {
                    IMethodDescData data   = runtime.GetMethodDescData(methodDesc);
                    DesktopMethod   method = (DesktopMethod)GetMethod(data.MDToken);
                    if (method.Type != this)
                    {
                        continue;
                    }
                    method.AddMethodHandle(methodDesc);
                }
            }
        }