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
return "No current execution frame"; return "No current execution frame";
try { try {
var val = WindowsDebugger.Evaluate(code); var val = WindowsDebugger.Evaluate(code, allowSetValue: true);
return ExpressionEvaluationVisitor.FormatValue(WindowsDebugger.EvalThread, val); return ExpressionEvaluationVisitor.FormatValue(WindowsDebugger.EvalThread, val);
} catch (GetValueException e) { } catch (GetValueException e) {
return e.Message; return e.Message;

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

@ -581,14 +581,14 @@ namespace ICSharpCode.SharpDevelop.Services
RefreshPads(); 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) if (CurrentStackFrame == null || CurrentStackFrame.NextStatement == null)
throw new GetValueException("no stackframe available!"); throw new GetValueException("no stackframe available!");
var location = CurrentStackFrame.NextStatement; var location = CurrentStackFrame.NextStatement;
var fileName = new FileName(location.Filename); 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); 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() public void JumpToCurrentLine()

Loading…
Cancel
Save