Browse Source

allow method execution in Console Pad, Conditional Breakpoints, Watch Pad and sub-tree nodes

pull/45/merge
Siegfried Pammer 12 years ago
parent
commit
4a2640af1a
  1. 2
      src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs
  2. 2
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  3. 12
      src/AddIns/Debugger/Debugger.Core/Value.cs

2
src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs

@ -326,6 +326,8 @@ namespace Debugger.AddIn @@ -326,6 +326,8 @@ namespace Debugger.AddIn
Value Visit(ConversionResolveResult result)
{
if (result.IsError)
throw new GetValueException("Cannot convert from '{0}' to '{1}'.", new CSharpAmbience().ConvertType(result.Input.Type), new CSharpAmbience().ConvertType(result.Type));
var val = Convert(result.Input);
if (result.Conversion.IsBoxingConversion)
return val;

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

@ -584,7 +584,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -584,7 +584,7 @@ namespace ICSharpCode.SharpDevelop.Services
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).Convert(rr);
return new ExpressionEvaluationVisitor(CurrentStackFrame, EvalThread, CurrentStackFrame.AppDomain.Compilation, true).Convert(rr);
}
public void JumpToCurrentLine()

12
src/AddIns/Debugger/Debugger.Core/Value.cs

@ -61,7 +61,8 @@ namespace Debugger @@ -61,7 +61,8 @@ namespace Debugger
[Debugger.Tests.Ignore]
public ICorDebugReferenceValue CorReferenceValue {
get {
if (IsNull) throw new GetValueException("Value is null");
if (IsNull)
throw new GetValueException("Value is null");
if (!(this.CorValue is ICorDebugReferenceValue))
throw new DebuggerException("Reference value expected");
@ -73,7 +74,8 @@ namespace Debugger @@ -73,7 +74,8 @@ namespace Debugger
[Debugger.Tests.Ignore]
public ICorDebugGenericValue CorGenericValue {
get {
if (IsNull) throw new GetValueException("Value is null");
if (IsNull)
throw new GetValueException("Value is null");
ICorDebugValue corValue = this.CorValue;
// Dereference and unbox if necessary
@ -90,7 +92,8 @@ namespace Debugger @@ -90,7 +92,8 @@ namespace Debugger
[Debugger.Tests.Ignore]
public ICorDebugArrayValue CorArrayValue {
get {
if (IsNull) throw new GetValueException("Value is null");
if (IsNull)
throw new GetValueException("Value is null");
if (this.Type.Kind != TypeKind.Array) throw new DebuggerException("Value is not an array");
@ -101,7 +104,8 @@ namespace Debugger @@ -101,7 +104,8 @@ namespace Debugger
[Debugger.Tests.Ignore]
public ICorDebugObjectValue CorObjectValue {
get {
if (IsNull) throw new GetValueException("Value is null");
if (IsNull)
throw new GetValueException("Value is null");
ICorDebugValue corValue = this.CorValue;
// Dereference and unbox if necessary

Loading…
Cancel
Save