当前位置: 首页>>代码示例>>C#>>正文


C# CorFrame.GetILOffset方法代码示例

本文整理汇总了C#中CorFrame.GetILOffset方法的典型用法代码示例。如果您正苦于以下问题:C# CorFrame.GetILOffset方法的具体用法?C# CorFrame.GetILOffset怎么用?C# CorFrame.GetILOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CorFrame的用法示例。


在下文中一共展示了CorFrame.GetILOffset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GoToIL

		public static bool GoToIL(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
			if (!CanGoToIL(frame))
				return false;

			var func = frame.Function;
			if (func == null)
				return false;

			return DebugUtils.GoToIL(moduleIdProvider, documentTabService, moduleLoader.LoadModule(func.Module, canLoadDynFile: true, isAutoLoaded: true), frame.Token, frame.GetILOffset(moduleLoader), newTab);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:FrameUtils.cs

示例2: GoToIL

		public static bool GoToIL(IFileTabManager fileTabManager, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
			if (!CanGoToIL(frame))
				return false;

			var func = frame.Function;
			if (func == null)
				return false;

			return DebugUtils.GoToIL(fileTabManager, moduleLoader.LoadModule(func.Module, true), frame.Token, frame.GetILOffset(moduleLoader), newTab);
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:10,代码来源:FrameUtils.cs

示例3: GoToIL

		public static bool GoToIL(CorFrame frame, bool newTab) {
			if (!CanGoToIL(frame))
				return false;

			var func = frame.Function;
			if (func == null)
				return false;

			return DebugUtils.GoToIL(ModuleLoader.Instance.LoadModule(func.Module, true), frame.Token, frame.GetILOffset(), newTab);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:FrameUtils.cs

示例4: GetCodeLocation

        CodeLocation? GetCodeLocation(CorFrame frame)
        {
            if (ProcessState != DebuggerProcessState.Stopped)
                return null;
            if (frame == null)
                return null;
            var sma = frame.GetSerializedDnModuleWithAssembly();
            if (sma == null)
                return null;
            uint token = frame.Token;
            if (token == 0)
                return null;

            return new CodeLocation(sma.Value, token, frame.GetILOffset(), frame.ILFrameIP.Mapping);
        }
开发者ID:andyhebear,项目名称:dnSpy,代码行数:15,代码来源:DebugManager.cs

示例5: GetStepRanges

        StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto)
        {
            if (frame == null)
                return null;
            if (!frame.IsILFrame)
                return null;
            if (frame.ILFrameIP.IsUnmappedAddress)
                return null;

            var key = CreateMethodKey(debugger, frame);
            if (key == null)
                return null;

            MemberMapping mapping;
            var textView = MainWindow.Instance.SafeActiveTextView;
            var cm = textView.CodeMappings;
            if (cm == null || !cm.TryGetValue(key.Value, out mapping)) {
                // User has decompiled some other code or switched to another tab
                UpdateCurrentMethod();
                JumpToCurrentStatement(textView);

                // It could be cached and immediately available. Check again
                cm = textView.CodeMappings;
                if (cm == null || !cm.TryGetValue(key.Value, out mapping))
                    return null;
            }

            bool isMatch;
            var scm = mapping.GetInstructionByOffset(frame.GetILOffset(), out isMatch);
            uint[] ilRanges;
            if (scm == null)
                ilRanges = mapping.ToArray(null, false);
            else
                ilRanges = scm.ToArray(isMatch);

            if (ilRanges.Length == 0)
                return null;
            return CreateStepRanges(ilRanges);
        }
开发者ID:andyhebear,项目名称:dnSpy,代码行数:39,代码来源:DebugManager.cs

示例6: GetStepRanges

		StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto) {
			if (frame == null)
				return null;
			if (!frame.IsILFrame)
				return null;
			if (frame.ILFrameIP.IsUnmappedAddress)
				return null;

			var key = CreateMethodKey(debugger, frame);
			if (key == null)
				return null;

			MethodDebugInfo info;
			var tab = documentTabService.GetOrCreateActiveTab();
			var documentViewer = tab.TryGetDocumentViewer();
			var methodDebugService = documentViewer.GetMethodDebugService();
			if ((info = methodDebugService.TryGetMethodDebugInfo(key.Value)) == null) {
				// User has decompiled some other code or switched to another tab
				UpdateCurrentMethod();
				JumpToCurrentStatement(tab);

				// It could be cached and immediately available. Check again
				documentViewer = tab.TryGetDocumentViewer();
				methodDebugService = documentViewer.GetMethodDebugService();
				if ((info = methodDebugService.TryGetMethodDebugInfo(key.Value)) == null)
					return null;
			}

			var sourceStatement = info.GetSourceStatementByCodeOffset(frame.GetILOffset(moduleLoader.Value));
			uint[] ranges;
			if (sourceStatement == null)
				ranges = info.GetUnusedRanges();
			else
				ranges = info.GetRanges(sourceStatement.Value);

			if (ranges.Length == 0)
				return null;
			return CreateStepRanges(ranges);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:39,代码来源:DebugService.cs

示例7: GetCodeLocation

		CodeLocation? GetCodeLocation(CorFrame frame) {
			if (ProcessState != DebuggerProcessState.Paused)
				return null;
			if (frame == null)
				return null;
			var func = frame.Function;
			if (func == null)
				return null;

			return new CodeLocation(func, frame.GetILOffset(moduleLoader.Value), frame.ILFrameIP.Mapping);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:DebugService.cs

示例8: GetStepRanges

		StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto) {
			if (frame == null)
				return null;
			if (!frame.IsILFrame)
				return null;
			if (frame.ILFrameIP.IsUnmappedAddress)
				return null;

			var key = CreateMethodKey(debugger, frame);
			if (key == null)
				return null;

			MemberMapping mapping;
			var tab = fileTabManager.GetOrCreateActiveTab();
			var uiContext = tab.TryGetTextEditorUIContext();
			var cm = uiContext.GetCodeMappings();
			if ((mapping = cm.TryGetMapping(key.Value)) == null) {
				// User has decompiled some other code or switched to another tab
				UpdateCurrentMethod();
				JumpToCurrentStatement(tab);

				// It could be cached and immediately available. Check again
				uiContext = tab.TryGetTextEditorUIContext();
				cm = uiContext.GetCodeMappings();
				if ((mapping = cm.TryGetMapping(key.Value)) == null)
					return null;
			}

			bool isMatch;
			var scm = mapping.GetInstructionByOffset(frame.GetILOffset(moduleLoader.Value), out isMatch);
			uint[] ilRanges;
			if (scm == null)
				ilRanges = mapping.ToArray(null, false);
			else
				ilRanges = scm.ToArray(isMatch);

			if (ilRanges.Length == 0)
				return null;
			return CreateStepRanges(ilRanges);
		}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:40,代码来源:DebugManager.cs


注:本文中的CorFrame.GetILOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。