Browse Source

allow assignment in debugger console pad

newNR
Siegfried Pammer 12 years ago
parent
commit
5ad61b926a
  1. 2
      src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs
  2. 4
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

2
src/AddIns/Debugger/Debugger.AddIn/Pads/ConsolePad.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -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;

4
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -581,14 +581,14 @@ namespace ICSharpCode.SharpDevelop.Services @@ -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()

Loading…
Cancel
Save