Ejemplo n.º 1
0
		/// <summary>
		/// We're done loading the initial threads.
		/// Notify the GUI that we're good to go.
		/// </summary>
		private void OnLoadThreadsDone(Dot42.DebuggerLib.Debugger debugger, DebugProcess debugProcess) {
			// Notify module
			//eventCallback.Send(program, new ModuleLoadEvent(program.MainModule, "Loading module", true));
			//eventCallback.Send(program, new SymbolSearchEvent(program.MainModule, "Symbols loaded", enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED));

			var mainThread = debugProcess.ThreadManager.MainThread();
			if (mainThread != null)
			{
				// Threads loaded
				// Load complete
				//eventCallback.Send(mainThread, new LoadCompleteEvent());
				//eventCallback.Send(mainThread, new EntryPointEvent());

				// Resume now
				debugger.VirtualMachine.ResumeAsync();
				
				// Notify SD
				Action onDebugStarted = () => {
					if (stateUpdate != null) {
						stateUpdate(LauncherStates.Attached, string.Empty);
						stateUpdate = null;
					}
					DebugStarted.Fire(this);
				};
				Dot42Addin.InvokeAsyncAndForget(onDebugStarted);
			}
			else
			{
				DLog.Error(DContext.VSDebuggerLauncher, "No main thread found");
			}
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Debug process has stopped.
		/// </summary>
		private void OnDebugProcessTerminated(object sender, EventArgs e) {
			DebugProcess = null;
			Dot42Addin.InvokeAsyncAndForget(() => {
			                                	try {
			                                		DebugStopped.Fire(this);
			                                	} catch (Exception ex) {
			                                		LoggingService.Warn("Error in DebugStopped", ex);
			                                		// Ignore
			                                	}
			                                	ResetBreakpointBookmark();
			                                });
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Attach to the given debugger and start debugging.
		/// </summary>
		public void Attach(string apkPath, Dot42.DebuggerLib.Debugger debugger, Guid debuggerGuid) {
			// Cleanup static state
			Launcher.GetAndRemoveDebugger(debuggerGuid, out stateUpdate);

			// Notify SD
			Dot42Addin.InvokeAsyncAndForget(() => DebugStarting.Fire(this));
			
			// Load map file
			var mapFilePath = Path.ChangeExtension(apkPath, ".d42map");
			var mapFile = File.Exists(mapFilePath) ? new MapFile(mapFilePath) : new MapFile();

			// Suspend and prepare the VM
			var suspend = debugger.VirtualMachine.SuspendAsync();
			var prepare = suspend.ContinueWith(t => {
			                                   	t.ForwardException();
			                                   	return debugger.PrepareAsync();
			                                   }).Unwrap();
			var debugProcess = new DebugProcess(debugger, mapFile);
			DebugProcess = debugProcess;
			var initializeBreakpoints = prepare.ContinueWith(t => {
			                                                 	t.ForwardException();
			                                                 	// Setup breakpoints
			                                                 	Dot42Addin.Invoke(() => debugProcess.BreakpointManager.InitializeBreakpoints(DebuggerService.Breakpoints));
			                                                 });
			var loadThreads = initializeBreakpoints.ContinueWith(t => {
			                                                     	t.ForwardException();
			                                                     	return debugProcess.ThreadManager.RefreshAsync();
			                                                     }).Unwrap();
			loadThreads.ContinueWith(t => {
			                         	t.ForwardException();
			                         	OnLoadThreadsDone(debugger, debugProcess);
			                         });
		}
Ejemplo n.º 4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugBreakpointManager(DebugProcess process) : base(process)
 {
 }
Ejemplo n.º 5
0
		/// <summary>
		/// Default ctor
		/// </summary>
		public DebugBreakpointManager(DebugProcess process) : base(process)
		{
		}
Ejemplo n.º 6
0
 public ThreadManager(DebugProcess process) : base(process)
 {
 }
Ejemplo n.º 7
0
 public ThreadManager(DebugProcess process)
     : base(process)
 {
 }