Exemplo n.º 1
0
		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);
		}
Exemplo n.º 2
0
		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);
		}
Exemplo n.º 3
0
		public static uint GetILOffset(this CorFrame frame, IModuleLoader moduleLoader) {
			var ip = frame.ILFrameIP;
			if (ip.IsExact || ip.IsApproximate)
				return ip.Offset;
			if (ip.IsProlog)
				return 0;

			if (ip.IsEpilog) {
				var mod = moduleLoader.LoadModule(frame.Function?.Module, canLoadDynFile: true, isAutoLoaded: true)?.ModuleDef;
				var md = mod?.ResolveToken(frame.Token) as MethodDef;
				if (md != null && md.Body != null && md.Body.Instructions.Count > 0)
					return md.Body.Instructions[md.Body.Instructions.Count - 1].Offset;
			}

			return uint.MaxValue;
		}
Exemplo n.º 4
0
		public static uint GetILOffset(this CorFrame frame, IModuleLoader moduleLoader) {
			var ip = frame.ILFrameIP;
			if (ip.IsExact || ip.IsApproximate)
				return ip.Offset;
			if (ip.IsProlog)
				return 0;

			if (ip.IsEpilog) {
				var func = frame.Function;
				var file = func == null ? null : moduleLoader.LoadModule(func.Module, true);
				var mod = file == null ? null : file.ModuleDef;
				var md = mod == null ? null : mod.ResolveToken(frame.Token) as MethodDef;
				if (md != null && md.Body != null && md.Body.Instructions.Count > 0)
					return md.Body.Instructions[md.Body.Instructions.Count - 1].Offset;
			}

			return uint.MaxValue;
		}
Exemplo n.º 5
0
		public static void GoToIL(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IModuleLoader moduleLoader, ModuleId moduleId, uint token, uint ilOffset, bool newTab) {
			var file = moduleLoader.LoadModule(moduleId, canLoadDynFile: true, diskFileOk: false, isAutoLoaded: true);
			GoToIL(moduleIdProvider, documentTabService, file, token, ilOffset, newTab);
		}
Exemplo n.º 6
0
		public static void GoToIL(IFileTabManager fileTabManager, IModuleLoader moduleLoader, SerializedDnModule serAsm, uint token, uint ilOffset, bool newTab) {
			var file = moduleLoader.LoadModule(serAsm, true);
			GoToIL(fileTabManager, file, token, ilOffset, newTab);
		}