Example #1
0
		internal DnAppDomain(DnProcess ownerProcess, ICorDebugAppDomain appDomain, int incrementedId) {
			this.ownerProcess = ownerProcess;
			this.assemblies = new DebuggerCollection<ICorDebugAssembly, DnAssembly>(CreateAssembly);
			this.appDomain = new CorAppDomain(appDomain);
			this.incrementedId = incrementedId;
			NameChanged();
		}
Example #2
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     this.Process         = ownerProcess;
     this.CorThread       = new CorThread(thread);
     this.UniqueId        = uniqueId;
     this.UniqueIdProcess = uniqueIdProcess;
 }
Example #3
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     Process         = ownerProcess;
     CorThread       = new CorThread(thread);
     UniqueId        = uniqueId;
     UniqueIdProcess = uniqueIdProcess;
 }
Example #4
0
		internal DnAppDomain(DnProcess ownerProcess, ICorDebugAppDomain appDomain, int uniqueId, int uniqueIdProcess) {
			Process = ownerProcess;
			assemblies = new DebuggerCollection<ICorDebugAssembly, DnAssembly>(CreateAssembly);
			CorAppDomain = new CorAppDomain(appDomain);
			UniqueId = uniqueId;
			UniqueIdProcess = uniqueIdProcess;
			NameChanged();
		}
Example #5
0
 public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread)
 {
     this.EventArgs = e;
     this.StopStates = null;
     this.Process = process;
     this.AppDomain = appDomain;
     this.Thread = thread;
 }
Example #6
0
 public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread)
 {
     EventArgs   = e;
     PauseStates = null;
     Process     = process;
     AppDomain   = appDomain;
     Thread      = thread;
 }
Example #7
0
 internal DnAppDomain(DnProcess ownerProcess, ICorDebugAppDomain appDomain, int incrementedId)
 {
     this.ownerProcess  = ownerProcess;
     this.assemblies    = new DebuggerCollection <ICorDebugAssembly, DnAssembly>(CreateAssembly);
     this.appDomain     = new CorAppDomain(appDomain);
     this.incrementedId = incrementedId;
     NameChanged();
 }
Example #8
0
 public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread)
 {
     this.EventArgs   = e;
     this.PauseStates = null;
     this.Process     = process;
     this.AppDomain   = appDomain;
     this.Thread      = thread;
 }
Example #9
0
		MemoryModuleDefFile(SimpleProcessReader simpleProcessReader, DnProcess process, ulong address, byte[] data, bool isInMemory, ModuleDef module, bool loadSyms, bool autoUpdateMemory)
			: base(module, loadSyms) {
			this.simpleProcessReader = simpleProcessReader;
			Process = process;
			Address = address;
			this.data = data;
			this.isInMemory = isInMemory;
			AutoUpdateMemory = autoUpdateMemory;
		}
Example #10
0
 internal DnAppDomain(DnProcess ownerProcess, ICorDebugAppDomain appDomain, int uniqueId, int uniqueIdProcess)
 {
     Process         = ownerProcess;
     assemblies      = new DebuggerCollection <ICorDebugAssembly, DnAssembly>(CreateAssembly);
     CorAppDomain    = new CorAppDomain(appDomain);
     UniqueId        = uniqueId;
     UniqueIdProcess = uniqueIdProcess;
     NameChanged();
 }
Example #11
0
		public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread) {
			this.LocalsOwner = localsOwner;
			this.Thread = thread;
			this.Process = thread.Process;

			// Read everything immediately since the frame will be neutered when Continue() is called
			this.FrameCouldBeNeutered = frame;
			frame.GetTypeAndMethodGenericParameters(out genericTypeArguments, out genericMethodArguments);
			this.Function = frame.Function;
		}
Example #12
0
		public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread, IList<CorType> genericTypeArguments) {
			this.LocalsOwner = localsOwner;
			this.Thread = thread;
			this.Process = thread.Process;

			// Read everything immediately since the frame will be neutered when Continue() is called
			this.FrameCouldBeNeutered = frame;
			this.genericTypeArguments = genericTypeArguments;
			this.genericMethodArguments = new CorType[0];
			this.Function = frame == null ? null : frame.Function;
		}
Example #13
0
		public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread, DnProcess process) {
			this.LocalsOwner = localsOwner;
			this.Thread = thread;
			this.Process = process;
			Debug.Assert(thread == null || thread.Process == process);

			// Read everything immediately since the frame will be neutered when Continue() is called
			this.FrameCouldBeNeutered = frame;
			if (frame == null) {
				genericTypeArguments = genericMethodArguments = new List<CorType>();
				this.Function = null;
			}
			else {
				frame.GetTypeAndMethodGenericParameters(out genericTypeArguments, out genericMethodArguments);
				this.Function = frame.Function;
			}
		}
Example #14
0
 public CorProcessReader(DnProcess process)
     : this(process.CorProcess)
 {
 }
Example #15
0
		internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess) {
			this.ownerProcess = ownerProcess;
			this.thread = new CorThread(thread);
			this.uniqueId = uniqueId;
			this.uniqueIdProcess = uniqueIdProcess;
		}
Example #16
0
		public static void ReadMemory(DnProcess process, ulong address, byte[] data, long index, int count) {
			ReadMemory(process.CorProcess.Handle, address, data, index, count);
		}
Example #17
0
		internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess) {
			Process = ownerProcess;
			CorThread = new CorThread(thread);
			UniqueId = uniqueId;
			UniqueIdProcess = uniqueIdProcess;
		}
Example #18
0
		string GetProcessFullPath(DnProcess process) {
			if (process == null)
				return "???";
			var name = process.Filename;
			if (string.IsNullOrEmpty(name))
				return string.Format("0x{0:X}", process.ProcessId);
			return name;
		}
Example #19
0
		public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread) {
			EventArgs = e;
			PauseStates = null;
			Process = process;
			AppDomain = appDomain;
			Thread = thread;
		}
Example #20
0
 public DnProcessHexStream(DnProcess process)
 {
     this.process = process;
 }
Example #21
0
		public CallStackFrameVM(ICallStackFrameContext context, int index, CorFrame frame, DnProcess process) {
			this.context = context;
			this.index = index;
			this.frame = frame;
			this.process = process;
		}
Example #22
0
		internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId) {
			this.ownerProcess = ownerProcess;
			this.thread = new CorThread(thread);
			this.incrementedId = incrementedId;
		}
Example #23
0
			public MyKey(DnProcess process, ulong address) {
				this.process = process;
				this.address = address;
			}
Example #24
0
		string GetProcessNameWithPID(DnProcess process) => string.Format("[0x{0:X}] {1}", process?.ProcessId ?? -1, GetProcessName(process));
Example #25
0
		public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread, List<CorType> genericTypeArguments) {
			LocalsOwner = localsOwner;
			Thread = thread;
			Process = thread.Process;

			// Read everything immediately since the frame will be neutered when Continue() is called
			FrameCouldBeNeutered = frame;
			this.genericTypeArguments = genericTypeArguments;
			genericMethodArguments = new List<CorType>();
			Function = frame?.Function;
		}
Example #26
0
		public static IDsDocumentNameKey CreateKey(DnProcess process, ulong address) => new MyKey(process, address);
Example #27
0
		public void SetFrame(CorFrame frame, DnProcess process) {
			this.frame = frame;
			this.process = process;

			if (cachedOutput == null || !HasPropertyChangedHandlers) {
				cachedOutput = null;
				OnPropertyChanged("NameObject");
			}
			else {
				var newCachedOutput = CachedOutput.Create(frame, Context.TypePrinterFlags);
				if (newCachedOutput.Equals(cachedOutput.Value))
					return;

				cachedOutput = newCachedOutput;
				OnPropertyChanged("NameObject");
			}
		}
Example #28
0
        void OnProcessTerminated(DnProcess process)
        {
            if (process == null)
                return;

            foreach (var appDomain in process.AppDomains) {
                OnAppDomainUnloaded(appDomain);
                process.AppDomainExited(appDomain.CorAppDomain.RawObject);
            }
        }
Example #29
0
		MemoryModuleDefFile(DnProcess process, ulong address, byte[] data, bool isInMemory, ModuleDef module, bool loadSyms, bool autoUpdateMemory)
			: base(module, loadSyms) {
			this.process = process;
			this.address = address;
			this.data = data;
			this.isInMemory = isInMemory;
			this.autoUpdateMemory = autoUpdateMemory;
		}
Example #30
0
			public DebugState(DnDebugger dbg) {
				this.dbg = dbg;

				Debug.Assert(dbg.Processes.Length == 1);
				debuggedProcess = dbg.Processes.FirstOrDefault();

				if (debuggedProcess != null) {
					const uint PROCESS_QUERY_LIMITED_INFORMATION = 0x1000;
					hProcess_debuggee = NativeMethods.OpenProcess2(PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)debuggedProcess.ProcessId);
					Debug.Assert(hProcess_debuggee != IntPtr.Zero, string.Format("OpenProcess() failed: 0x{0:X8}", Marshal.GetLastWin32Error()));
				}
			}
Example #31
0
 public abstract CorDebugJITCompilerFlags GetDesiredNGENCompilerFlags(DnProcess process);
Example #32
0
		public static IDnSpyFilenameKey CreateKey(DnProcess process, ulong address) {
			return new MyKey(process, address);
		}
Example #33
0
        void InitializeCurrentDebuggerState(DebugCallbackEventArgs e, DnProcess process)
        {
            if (process == null) {
                SetDefaultCurrentProcess(e);
                return;
            }

            AddDebuggerState(new DebuggerState(e, process, null, null));
        }
Example #34
0
		public CorProcessReader(DnProcess process)
			: this(process.CorProcess) {
		}
Example #35
0
        void ProcessStopped(DnProcess process, bool addStopState)
        {
            this.managedCallbackCounter++;
            if (!addStopState)
                return;

            DnThread thread = process.GetMainThread();
            DnAppDomain appDomain = thread == null ? process.GetMainAppDomain() : thread.AppDomainOrNull;
            AddDebuggerState(new DebuggerState(null, process, appDomain, thread) {
                StopStates = new DebuggerStopState[] {
                    new DebuggerStopState(DebuggerStopReason.UserBreak),
                }
            });

            CallOnProcessStateChanged();
        }
Example #36
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId)
 {
     this.ownerProcess  = ownerProcess;
     this.thread        = new CorThread(thread);
     this.incrementedId = incrementedId;
 }