public void UpdateDebuggingUI()
        {
            if (!DebuggerService.IsDebuggerStarted)
            {
                return;
            }
            if (decompiledType == null || decompiledType.MetadataToken == null)
            {
                return;
            }

            int typeToken = decompiledType.MetadataToken.ToInt32();

            if (!DebuggerDecompilerService.DebugInformation.ContainsKey(typeToken))
            {
                return;
            }
            var decompilerService = DebuggerDecompilerService.Instance;

            if (decompilerService == null || decompilerService.DebugStepInformation == null)
            {
                return;
            }

            // get debugging information
            DecompileInformation debugInformation = (DecompileInformation)DebuggerDecompilerService.DebugInformation[typeToken];
            int             methodToken           = decompilerService.DebugStepInformation.Item1;
            int             ilOffset = decompilerService.DebugStepInformation.Item2;
            int             line;
            MemberReference member;

            if (debugInformation.CodeMappings == null || !debugInformation.CodeMappings.ContainsKey(methodToken))
            {
                return;
            }

            debugInformation.CodeMappings[methodToken].GetInstructionByTokenAndOffset(methodToken, ilOffset, out member, out line);

            // if the codemappings are not built
            if (line <= 0)
            {
                DebuggerService.CurrentDebugger.StepOver();
                return;
            }

            // jump to line - scoll and unfold
            this.UpdateCurrentLineBookmark(line);
            this.JumpToLineNumber(line);
        }
示例#2
0
        public bool CheckMappings(int typeToken)
        {
            DecompileInformation data = null;

            DebugInformation.TryGetValue(typeToken, out data);
            DecompileInformation information = data as DecompileInformation;

            if (information == null)
            {
                return(false);
            }

            if (information.CodeMappings == null)
            {
                return(false);
            }

            return(true);
        }