public void Continue() { if (!IsDebugging) { MessageBox.Show(errorNotDebugging, "Continue"); return; } if (IsProcessRunning) { MessageBox.Show(errorProcessRunning, "Continue"); return; } debuggedProcess.AsyncContinue(); }
public void Continue() { if (!IsDebugging) { MessageService.ShowMessage(errorNotDebugging, "${res:XML.MainMenu.DebugMenu.Continue}"); return; } if (IsProcessRunning) { MessageService.ShowMessage(errorProcessRunning, "${res:XML.MainMenu.DebugMenu.Continue}"); return; } debuggedProcess.AsyncContinue(); }
public void Continue() { if (!IsDebugging) { MainWindow.Instance.ShowMessageBox(errorNotDebugging + " : Continue"); return; } if (IsProcessRunning) { MainWindow.Instance.ShowMessageBox(errorProcessRunning + " : Continue"); return; } debuggedProcess.AsyncContinue(); }
/// <exception cref="GetValueException">Can not evaluate in optimized code</exception> static Eval CreateEval(Process process, string description, EvalStarter evalStarter) { ICorDebugEval corEval = CreateCorEval(process); Eval newEval = new Eval(process, description, corEval); try { evalStarter(newEval); } catch (COMException e) { if ((uint)e.ErrorCode == 0x80131C26) { throw new GetValueException("Can not evaluate in optimized code"); } else if ((uint)e.ErrorCode == 0x80131C28) { throw new GetValueException("Object is in wrong AppDomain"); } else if ((uint)e.ErrorCode == 0x8013130A) { // Happens on getting of Sytem.Threading.Thread.ManagedThreadId; See SD2-1116 throw new GetValueException("Function does not have IL code"); } else if ((uint)e.ErrorCode == 0x80131C23) { // The operation failed because it is a GC unsafe point. (Exception from HRESULT: 0x80131C23) // This can probably happen when we break and the thread is in native code throw new GetValueException("Thread is in GC unsafe point"); } else if ((uint)e.ErrorCode == 0x80131C22) { // The operation is illegal because of a stack overflow. throw new GetValueException("Can not evaluate after stack overflow"); } else if ((uint)e.ErrorCode == 0x80131313) { // Func eval cannot work. Bad starting point. // Reproduction circumstancess are unknown throw new GetValueException("Func eval cannot work. Bad starting point."); } else { #if DEBUG throw; // Expose for more diagnostics #else throw new GetValueException(e.Message); #endif } } process.NotifyEvaluationStarted(newEval); process.AsyncContinue(DebuggeeStateAction.Keep); return newEval; }
/// <summary> Tryies to intercept the current exception. /// The intercepted expression stays available through the CurrentException property. </summary> /// <returns> False, if the exception was already intercepted or /// if it can not be intercepted. </returns> public bool InterceptException(Exception exception) { if (!(this.CorThread is ICorDebugThread2)) { return(false); // Is the debuggee .NET 2.0? } if (this.CorThread.GetCurrentException() == null) { return(false); // Is there any exception } if (this.MostRecentStackFrame == null) { return(false); // Is frame available? It is not at StackOverflow } // Intercepting an exception on an optimized/NGENed frame seems to sometimes // freeze the debugee (as of .NET 4.0, it was ok in .NET 2.0) // eg. Convert.ToInt64(ulong.MaxValue) causes such freeze StackFrame mostRecentUnoptimized = null; foreach (StackFrame sf in this.Callstack) { if (sf.MethodInfo.DebugModule.CorModule2.GetJITCompilerFlags() != 1) // CORDEBUG_JIT_DEFAULT { mostRecentUnoptimized = sf; break; } } if (mostRecentUnoptimized == null) { return(false); } if (exception == null) { exception = currentException; } try { // Interception will expire the CorValue so keep permanent reference exception.MakeValuePermanent(); ((ICorDebugThread2)this.CorThread).InterceptCurrentException(mostRecentUnoptimized.CorILFrame); } catch (COMException e) { // 0x80131C02: Cannot intercept this exception if ((uint)e.ErrorCode == 0x80131C02) { return(false); } // 0x80131C33: Interception of the current exception is not legal if ((uint)e.ErrorCode == 0x80131C33) { return(false); } // 0x80004005: Error HRESULT E_FAIL has been returned from a call to a COM component. // Use this to reproduce: new FileIOPermission(PermissionState.Unrestricted).Deny(); if ((uint)e.ErrorCode == 0x80004005) { return(false); } throw; } catch (ArgumentException) { // May happen in release code with does not have any symbols return(false); } process.AsyncContinue(DebuggeeStateAction.Keep, new Thread[] { this /* needed */ }, null); process.WaitForPause(); return(true); }
/// <summary> Step out of the stack frame </summary> public void AsyncStepOut() { Stepper.StepOut(this, "normal"); process.AsyncContinue(DebuggeeStateAction.Clear); }