diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs index 9378c11193..3b9eff649c 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs @@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads return "No current execution frame"; try { - var val = WindowsDebugger.Evaluate(code); + var val = WindowsDebugger.Evaluate(code, allowSetValue: true); return ExpressionEvaluationVisitor.FormatValue(WindowsDebugger.EvalThread, val); } catch (GetValueException e) { return e.Message; diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs index 60004c1db6..b1f06c7ced 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs @@ -581,14 +581,14 @@ namespace ICSharpCode.SharpDevelop.Services RefreshPads(); } - public static Value Evaluate(string code) + public static Value Evaluate(string code, bool allowMethodInvoke = true, bool allowSetValue = false) { if (CurrentStackFrame == null || CurrentStackFrame.NextStatement == null) throw new GetValueException("no stackframe available!"); var location = CurrentStackFrame.NextStatement; var fileName = new FileName(location.Filename); var rr = SD.ParserService.ResolveSnippet(fileName, new TextLocation(location.StartLine, location.StartColumn), new ParseableFileContentFinder().Create(fileName), code, null, System.Threading.CancellationToken.None); - return new ExpressionEvaluationVisitor(CurrentStackFrame, EvalThread, CurrentStackFrame.AppDomain.Compilation, true).Convert(rr); + return new ExpressionEvaluationVisitor(CurrentStackFrame, EvalThread, CurrentStackFrame.AppDomain.Compilation, allowMethodInvoke, allowSetValue).Convert(rr); } public void JumpToCurrentLine()