Ejemplo n.º 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();
		}
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     Process         = ownerProcess;
     CorThread       = new CorThread(thread);
     UniqueId        = uniqueId;
     UniqueIdProcess = uniqueIdProcess;
 }
Ejemplo n.º 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();
		}
Ejemplo n.º 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;
 }
Ejemplo n.º 6
0
 public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread)
 {
     EventArgs   = e;
     PauseStates = null;
     Process     = process;
     AppDomain   = appDomain;
     Thread      = thread;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 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();
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
			}
		}
Ejemplo n.º 14
0
 public CorProcessReader(DnProcess process)
     : this(process.CorProcess)
 {
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 16
0
		public static void ReadMemory(DnProcess process, ulong address, byte[] data, long index, int count) {
			ReadMemory(process.CorProcess.Handle, address, data, index, count);
		}
Ejemplo n.º 17
0
		internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess) {
			Process = ownerProcess;
			CorThread = new CorThread(thread);
			UniqueId = uniqueId;
			UniqueIdProcess = uniqueIdProcess;
		}
Ejemplo n.º 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;
		}
Ejemplo n.º 19
0
		public DebuggerState(DebugCallbackEventArgs e, DnProcess process, DnAppDomain appDomain, DnThread thread) {
			EventArgs = e;
			PauseStates = null;
			Process = process;
			AppDomain = appDomain;
			Thread = thread;
		}
Ejemplo n.º 20
0
 public DnProcessHexStream(DnProcess process)
 {
     this.process = process;
 }
Ejemplo n.º 21
0
		public CallStackFrameVM(ICallStackFrameContext context, int index, CorFrame frame, DnProcess process) {
			this.context = context;
			this.index = index;
			this.frame = frame;
			this.process = process;
		}
Ejemplo n.º 22
0
		internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId) {
			this.ownerProcess = ownerProcess;
			this.thread = new CorThread(thread);
			this.incrementedId = incrementedId;
		}
Ejemplo n.º 23
0
			public MyKey(DnProcess process, ulong address) {
				this.process = process;
				this.address = address;
			}
Ejemplo n.º 24
0
		string GetProcessNameWithPID(DnProcess process) => string.Format("[0x{0:X}] {1}", process?.ProcessId ?? -1, GetProcessName(process));
Ejemplo n.º 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;
		}
Ejemplo n.º 26
0
		public static IDsDocumentNameKey CreateKey(DnProcess process, ulong address) => new MyKey(process, address);
Ejemplo n.º 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");
			}
		}
Ejemplo n.º 28
0
        void OnProcessTerminated(DnProcess process)
        {
            if (process == null)
                return;

            foreach (var appDomain in process.AppDomains) {
                OnAppDomainUnloaded(appDomain);
                process.AppDomainExited(appDomain.CorAppDomain.RawObject);
            }
        }
Ejemplo n.º 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;
		}
Ejemplo n.º 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()));
				}
			}
Ejemplo n.º 31
0
 public abstract CorDebugJITCompilerFlags GetDesiredNGENCompilerFlags(DnProcess process);
Ejemplo n.º 32
0
		public static IDnSpyFilenameKey CreateKey(DnProcess process, ulong address) {
			return new MyKey(process, address);
		}
Ejemplo n.º 33
0
        void InitializeCurrentDebuggerState(DebugCallbackEventArgs e, DnProcess process)
        {
            if (process == null) {
                SetDefaultCurrentProcess(e);
                return;
            }

            AddDebuggerState(new DebuggerState(e, process, null, null));
        }
Ejemplo n.º 34
0
		public CorProcessReader(DnProcess process)
			: this(process.CorProcess) {
		}
Ejemplo n.º 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();
        }
Ejemplo n.º 36
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId)
 {
     this.ownerProcess  = ownerProcess;
     this.thread        = new CorThread(thread);
     this.incrementedId = incrementedId;
 }