/// <summary> /// Debugger has connected. /// </summary> private void OnDebuggerDalvikEvent(object sender, JdwpEvent e) { DLog.Debug(DContext.VSDebuggerEvent, "DalvikEvent {0}", e); var debugger = (XDebugger)sender; if (!debugger.Connected || token.IsCancellationRequested) { return; } if ((debugger.AppName == packageName) && !debuggerLaunched) { // Inform status debuggerLaunched = true; outputPane.LogLine("Found process to debug"); // We've found the process to debug. var currentMonitor = jdwpMonitor; jdwpMonitor = null; debugger.Attach(currentMonitor); DisposeOtherDebuggers(debugger); // Prepare the debugger stateUpdate(LauncherStates.Attaching, string.Empty); outputPane.LogLine("Preparing debugger launch"); try { LaunchVsDebugEngine(ide, apkPath, debugger, launchFlags, stateUpdate); } catch (Exception ex) { stateUpdate(LauncherStates.Error, ex.Message); } } }
/// <summary> /// Notify clients of the given event. /// </summary> private void OnEventAsync(JdwpEvent @event) { Task.Factory.StartNew(() => JdwpEvent.Fire(this, @event)); }
/// <summary> /// Notify clients of the given event. /// </summary> private void OnEventAsync(JdwpEvent @event) { Task.Factory.StartNew(() => JdwpEvent.Fire(this, @event)) .ContinueWith(task => { DLog.Error(DContext.DebuggerLibJdwpConnection, "OnEventAsync: Internal failure on event processing. IsCancelled={0}. Exception={1}", task.IsCanceled, task.Exception); }, TaskContinuationOptions.NotOnRanToCompletion); }
/// <summary> /// Debugger has connected. /// </summary> private void OnDebuggerDalvikEvent(object sender, JdwpEvent e) { DLog.Debug(DContext.VSDebuggerEvent, "DalvikEvent {0}", e); var debugger = (XDebugger)sender; if (!debugger.Connected || token.IsCancellationRequested) return; if ((debugger.AppName == packageName) && !debuggerLaunched) { // Inform status debuggerLaunched = true; outputPane.LogLine("Found process to debug"); // We've found the process to debug. var currentMonitor = jdwpMonitor; jdwpMonitor = null; debugger.Attach(currentMonitor); DisposeOtherDebuggers(debugger); // Prepare the debugger stateUpdate(LauncherStates.Attaching, string.Empty); outputPane.LogLine("Preparing debugger launch"); try { LaunchVsDebugEngine(ide, apkPath, debugger, launchFlags, stateUpdate); } catch (Exception ex) { stateUpdate(LauncherStates.Error, ex.Message); } } }