Browse Source

Started porting the debugger code to use new NRefactory

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
edd396a82c
  1. 11
      Debugger/Debugger.Core/Debugger.Core.csproj
  2. 3
      Debugger/Debugger.Core/Debugger.Core.csproj.user
  3. 8
      Debugger/Debugger.Core/GetValueException.cs
  4. 79
      Debugger/Debugger.Core/NRefactory/Ast/ExpressionExtensionMethods.cs
  5. 126
      Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs
  6. 4
      Debugger/Debugger.Core/Process.cs
  7. 4
      Debugger/ILSpy.Debugger/AvalonEdit/Editor/IDocument.cs
  8. 4
      Debugger/ILSpy.Debugger/AvalonEdit/Editor/ITextAnchor.cs
  9. 14
      Debugger/ILSpy.Debugger/Bookmarks/BookmarkBase.cs
  10. 5
      Debugger/ILSpy.Debugger/Bookmarks/BookmarkManager.cs
  11. 4
      Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs
  12. 5
      Debugger/ILSpy.Debugger/Bookmarks/CurrentLineBookmark.cs
  13. 1
      Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj
  14. 3
      Debugger/ILSpy.Debugger/Services/Debugger/IDebugger.cs
  15. 5
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs
  16. 20
      ILSpy.sln
  17. 510
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/NotImplementedAstVisitor.cs
  18. 2
      NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj
  19. 12
      NRefactory/ICSharpCode.NRefactory/SupportedLanguage.cs

11
Debugger/Debugger.Core/Debugger.Core.csproj

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<OutputPath>..\..\..\..\AddIns\Debugger\</OutputPath>
<OutputPath>\bin</OutputPath>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PublishUrl>http://localhost/Debugger.Core/</PublishUrl>
<Install>true</Install>
@ -37,7 +37,8 @@ @@ -37,7 +37,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -51,8 +52,14 @@ @@ -51,8 +52,14 @@
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<StartAction>Project</StartAction>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>

3
Debugger/Debugger.Core/Debugger.Core.csproj.user

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<LastOpenVersion>8.0.50215</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>

8
Debugger/Debugger.Core/GetValueException.cs

@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.CSharp;
namespace Debugger
{
public class GetValueException: DebuggerException
{
INode expression;
AstNode expression;
string error;
/// <summary> Expression that has caused this exception to occur </summary>
public INode Expression {
public AstNode Expression {
get { return expression; }
set { expression = value; }
}
@ -32,7 +32,7 @@ namespace Debugger @@ -32,7 +32,7 @@ namespace Debugger
}
}
public GetValueException(INode expression, string error):base(error)
public GetValueException(AstNode expression, string error):base(error)
{
this.expression = expression;
this.error = error;

79
Debugger/Debugger.Core/NRefactory/Ast/ExpressionExtensionMethods.cs

@ -8,7 +8,7 @@ using System.Reflection; @@ -8,7 +8,7 @@ using System.Reflection;
using Debugger;
using Debugger.MetaData;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.PrettyPrinter;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.Visitors;
namespace ICSharpCode.NRefactory.Ast
@ -20,15 +20,15 @@ namespace ICSharpCode.NRefactory.Ast @@ -20,15 +20,15 @@ namespace ICSharpCode.NRefactory.Ast
return ExpressionEvaluator.Evaluate(expression, process);
}
static M SetStaticType<M>(this M expr, DebugType type) where M: INode
static M SetStaticType<M>(this M expr, DebugType type) where M: AstNode
{
expr.UserData = type;
expr.AddAnnotation(type);
return expr;
}
public static DebugType GetStaticType(this INode expr)
public static DebugType GetStaticType(this AstNode expr)
{
return expr.UserData as DebugType;
return expr.Annotation<DebugType>();
}
public static Expression Parenthesize(this Expression expr)
@ -39,7 +39,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -39,7 +39,7 @@ namespace ICSharpCode.NRefactory.Ast
expr is ParenthesizedExpression ||
expr is PrimitiveExpression)
return expr;
return new ParenthesizedExpression(expr);
return new ParenthesizedExpression() { Expression = expr };
}
public static Expression CastTo(this Expression expresion, DebugType castTo)
@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.Ast
if (val != null && val.GetType().FullName == castTo.FullName)
return expresion;
}
return new CastExpression(castTo.GetTypeReference(), expresion.Parenthesize(), CastType.Cast);
return new CastExpression() { Expression = expresion.Parenthesize(), Type = castTo.GetTypeReference() };
}
public static Expression GetExpression(this DebugLocalVariableInfo locVar)
@ -67,15 +67,18 @@ namespace ICSharpCode.NRefactory.Ast @@ -67,15 +67,18 @@ namespace ICSharpCode.NRefactory.Ast
public static UnaryOperatorExpression AppendDereference(this Expression expression)
{
return new UnaryOperatorExpression(new ParenthesizedExpression(expression), UnaryOperatorType.Dereference);
return new UnaryOperatorExpression(UnaryOperatorType.Dereference, new ParenthesizedExpression() { Expression = expression });
}
public static IndexerExpression AppendIndexer(this Expression expression, params int[] indices)
{
IndexerExpression indexerExpr = new IndexerExpression(Parenthesize(expression), new List<Expression>());
IndexerExpression indexerExpr = new IndexerExpression() { Target = Parenthesize(expression) };
var args = new List<Expression>();
foreach(int index in indices) {
indexerExpr.Indexes.Add(new PrimitiveExpression(index));
args.Add(new PrimitiveExpression(index));
}
indexerExpr.Arguments = args;
DebugType staticType = expression.GetStaticType();
if (staticType != null && staticType.IsArray)
indexerExpr.SetStaticType((DebugType)staticType.GetElementType());
@ -88,9 +91,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -88,9 +91,7 @@ namespace ICSharpCode.NRefactory.Ast
{
Expression target;
if (memberInfo.IsStatic) {
target = new TypeReferenceExpression(
memberInfo.DeclaringType.GetTypeReference()
);
target = new TypeReferenceExpression() { Type = memberInfo.DeclaringType.GetTypeReference() };
} else {
target = expresion.CastTo((DebugType)memberInfo.DeclaringType);
}
@ -98,14 +99,16 @@ namespace ICSharpCode.NRefactory.Ast @@ -98,14 +99,16 @@ namespace ICSharpCode.NRefactory.Ast
if (memberInfo is DebugFieldInfo) {
if (args.Length > 0)
throw new DebuggerException("No arguments expected for a field");
return new MemberReferenceExpression(target, memberInfo.Name).SetStaticType(memberInfo.MemberType);
var mre = new MemberReferenceExpression() { Target = target, MemberName = memberInfo.Name };
return mre.SetStaticType(memberInfo.MemberType);
}
if (memberInfo is MethodInfo) {
return new InvocationExpression(
new MemberReferenceExpression(target, memberInfo.Name),
AddExplicitTypes((MethodInfo)memberInfo, args)
).SetStaticType(memberInfo.MemberType);
var mre = new MemberReferenceExpression() { Target = target, MemberName = memberInfo.Name };
var ie = new InvocationExpression() { Target = mre, Arguments = AddExplicitTypes((MethodInfo)memberInfo, args) };
return ie.SetStaticType(memberInfo.MemberType);
}
if (memberInfo is PropertyInfo) {
@ -113,12 +116,9 @@ namespace ICSharpCode.NRefactory.Ast @@ -113,12 +116,9 @@ namespace ICSharpCode.NRefactory.Ast
if (args.Length > 0) {
if (memberInfo.Name != "Item")
throw new DebuggerException("Arguments expected only for the Item property");
return new IndexerExpression(
target,
AddExplicitTypes(propInfo.GetGetMethod() ?? propInfo.GetSetMethod(), args)
).SetStaticType(memberInfo.MemberType);
return (new IndexerExpression() { Target = target, Arguments = AddExplicitTypes(propInfo.GetGetMethod() ?? propInfo.GetSetMethod(), args) }).SetStaticType(memberInfo.MemberType);
} else {
return new MemberReferenceExpression(target, memberInfo.Name).SetStaticType(memberInfo.MemberType);
return (new MemberReferenceExpression() { Target = target, MemberName = memberInfo.Name }).SetStaticType(memberInfo.MemberType);
}
}
@ -146,7 +146,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -146,7 +146,7 @@ namespace ICSharpCode.NRefactory.Ast
return ((DebugType)type).CanImplicitelyConvertTo(toType);
}
public static string PrettyPrint(this INode code)
public static string PrettyPrint(this AstNode code)
{
if (code == null) return string.Empty;
CSharpOutputVisitor csOutVisitor = new CSharpOutputVisitor();
@ -154,7 +154,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -154,7 +154,7 @@ namespace ICSharpCode.NRefactory.Ast
return csOutVisitor.Text;
}
public static TypeReference GetTypeReference(this Type type)
public static AstType GetTypeReference(this Type type)
{
List<int> arrayRanks = new List<int>();
while(type.IsArray) {
@ -183,14 +183,14 @@ namespace ICSharpCode.NRefactory.Ast @@ -183,14 +183,14 @@ namespace ICSharpCode.NRefactory.Ast
genArgs.AddRange(type.GetGenericArguments());
if (type.DeclaringType != null)
genArgs.RemoveRange(0, type.DeclaringType.GetGenericArguments().Length);
List<TypeReference> genTypeRefs = new List<TypeReference>();
List<AstType> genTypeRefs = new List<AstType>();
foreach(Type genArg in genArgs) {
genTypeRefs.Add(genArg.GetTypeReference());
}
if (type.DeclaringType != null) {
TypeReference outterRef = type.DeclaringType.GetTypeReference();
InnerClassTypeReference innerRef = new InnerClassTypeReference(outterRef, name, genTypeRefs);
var outterRef = type.DeclaringType.GetTypeReference();
var innerRef = new InnerClassTypeReference(outterRef, name, genTypeRefs);
innerRef.PointerNestingLevel = pointerNest;
innerRef.RankSpecifier = arrayRanks.ToArray();
return innerRef.SetStaticType((DebugType)type);
@ -204,15 +204,14 @@ namespace ICSharpCode.NRefactory.Ast @@ -204,15 +204,14 @@ namespace ICSharpCode.NRefactory.Ast
/// Dotted names are split into separate nodes.
/// It does not normalize generic arguments.
/// </summary>
static TypeReference NormalizeTypeReference(this INode expr)
static SimpleType NormalizeTypeReference(this AstNode expr)
{
if (expr is IdentifierExpression) {
return new TypeReference(
((IdentifierExpression)expr).Identifier,
((IdentifierExpression)expr).TypeArguments
);
return new SimpleType() {
Identifier = ((IdentifierExpression)expr).Identifier,
TypeArguments = ((IdentifierExpression)expr).TypeArguments};
} else if (expr is MemberReferenceExpression) {
TypeReference outter = NormalizeTypeReference(((MemberReferenceExpression)expr).TargetObject);
var outter = NormalizeTypeReference(((MemberReferenceExpression)expr).Target);
return new InnerClassTypeReference(
outter,
((MemberReferenceExpression)expr).MemberName,
@ -223,7 +222,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -223,7 +222,7 @@ namespace ICSharpCode.NRefactory.Ast
} else if (expr is InnerClassTypeReference) { // Frist - it is also TypeReference
InnerClassTypeReference typeRef = (InnerClassTypeReference)expr;
string[] names = typeRef.Type.Split('.');
TypeReference newRef = NormalizeTypeReference(typeRef.BaseType);
var newRef = NormalizeTypeReference(typeRef.BaseType);
foreach(string name in names) {
newRef = new InnerClassTypeReference(newRef, name, new List<TypeReference>());
}
@ -232,7 +231,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -232,7 +231,7 @@ namespace ICSharpCode.NRefactory.Ast
newRef.RankSpecifier = typeRef.RankSpecifier;
return newRef;
} else if (expr is TypeReference) {
TypeReference typeRef = (TypeReference)expr;
var typeRef = (TypeReference)expr;
string[] names = typeRef.Type.Split('.');
if (names.Length == 1)
return typeRef;
@ -241,7 +240,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -241,7 +240,7 @@ namespace ICSharpCode.NRefactory.Ast
if (newRef == null) {
newRef = new TypeReference(name, new List<TypeReference>());
} else {
newRef = new InnerClassTypeReference(newRef, name, new List<TypeReference>());
newRef = new TypeReference(newRef, name, new List<TypeReference>());
}
}
newRef.GenericTypes.AddRange(typeRef.GenericTypes);
@ -253,7 +252,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -253,7 +252,7 @@ namespace ICSharpCode.NRefactory.Ast
}
}
static string GetNameWithArgCounts(TypeReference typeRef)
static string GetNameWithArgCounts(SimpleType typeRef)
{
string name = typeRef.Type;
if (typeRef.GenericTypes.Count > 0)
@ -265,7 +264,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -265,7 +264,7 @@ namespace ICSharpCode.NRefactory.Ast
}
}
public static DebugType ResolveType(this INode expr, Debugger.AppDomain appDomain)
public static DebugType ResolveType(this AstNode expr, Debugger.AppDomain appDomain)
{
if (expr is TypeReference && expr.GetStaticType() != null)
return expr.GetStaticType();
@ -295,7 +294,7 @@ namespace ICSharpCode.NRefactory.Ast @@ -295,7 +294,7 @@ namespace ICSharpCode.NRefactory.Ast
/// For performance this is separate method.
/// 'genArgs' should hold type for each generic parameter in 'typeRef'.
/// </summary>
static DebugType ResolveTypeInternal(TypeReference typeRef, DebugType[] genArgs, Debugger.AppDomain appDomain)
static DebugType ResolveTypeInternal(SimpleType typeRef, DebugType[] genArgs, Debugger.AppDomain appDomain)
{
DebugType type = null;

126
Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs

@ -4,19 +4,21 @@ @@ -4,19 +4,21 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Debugger;
using Debugger.MetaData;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.CSharp;
namespace ICSharpCode.NRefactory.Visitors
{
public class EvaluateException: GetValueException
{
public EvaluateException(INode code, string msg):base(code, msg) {}
public EvaluateException(INode code, string msgFmt, params string[] msgArgs):base(code, string.Format(msgFmt, msgArgs)) {}
public EvaluateException(AstNode code, string msg):base(code, msg) {}
public EvaluateException(AstNode code, string msgFmt, params string[] msgArgs):base(code, string.Format(msgFmt, msgArgs)) {}
}
class TypedValue
@ -43,7 +45,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -43,7 +45,7 @@ namespace ICSharpCode.NRefactory.Visitors
}
}
public class ExpressionEvaluator : NotImplementedAstVisitor
public class ExpressionEvaluator : NotImplementedAstVisitor<object, object>
{
StackFrame context;
@ -56,10 +58,10 @@ namespace ICSharpCode.NRefactory.Visitors @@ -56,10 +58,10 @@ namespace ICSharpCode.NRefactory.Visitors
this.context = context;
}
public static INode Parse(string code, SupportedLanguage language)
public static AstNode Parse(string code, SupportedLanguage language)
{
SnippetParser parser = new SnippetParser(language);
INode astRoot = parser.Parse(code);
AstNode astRoot = parser.Parse(code);
if (parser.Errors.Count > 0) {
throw new GetValueException(parser.Errors.ErrorOutput);
}
@ -76,7 +78,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -76,7 +78,7 @@ namespace ICSharpCode.NRefactory.Visitors
return Evaluate(Parse(code, language), context);
}
public static Value Evaluate(INode code, Process context)
public static Value Evaluate(AstNode code, Process context)
{
if (context.SelectedStackFrame != null) {
return Evaluate(code, context.SelectedStackFrame);
@ -88,7 +90,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -88,7 +90,7 @@ namespace ICSharpCode.NRefactory.Visitors
}
}
public static Value Evaluate(INode code, StackFrame context)
public static Value Evaluate(AstNode code, StackFrame context)
{
if (context == null) throw new ArgumentNullException("context");
if (context.IsInvalid) throw new DebuggerException("The context is no longer valid");
@ -105,7 +107,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -105,7 +107,7 @@ namespace ICSharpCode.NRefactory.Visitors
public static Expression ParseExpression(string code, SupportedLanguage language)
{
SnippetParser parser = new SnippetParser(language);
INode astRoot = parser.Parse(code);
AstNode astRoot = parser.Parse(code);
if (parser.Errors.Count > 0) {
throw new GetValueException(parser.Errors.ErrorOutput);
}
@ -159,12 +161,12 @@ namespace ICSharpCode.NRefactory.Visitors @@ -159,12 +161,12 @@ namespace ICSharpCode.NRefactory.Visitors
}
}
TypedValue Evaluate(INode expression)
TypedValue Evaluate(AstNode expression)
{
return Evaluate(expression, true);
}
TypedValue Evaluate(INode expression, bool permRef)
TypedValue Evaluate(AstNode expression, bool permRef)
{
// Try to get the value from cache
// (the cache is cleared when the process is resumed)
@ -199,16 +201,16 @@ namespace ICSharpCode.NRefactory.Visitors @@ -199,16 +201,16 @@ namespace ICSharpCode.NRefactory.Visitors
return val;
}
List<TypedValue> EvaluateAll(List<Expression> exprs)
IList<TypedValue> EvaluateAll(IEnumerable<Expression> exprs)
{
List<TypedValue> vals = new List<TypedValue>(exprs.Count);
var vals = new List<TypedValue>(exprs.Count());
foreach(Expression expr in exprs) {
vals.Add(Evaluate(expr));
}
return vals;
}
int EvaluateAsInt(INode expression)
int EvaluateAsInt(AstNode expression)
{
if (expression is PrimitiveExpression) {
int? i = ((PrimitiveExpression)expression).Value as int?;
@ -226,7 +228,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -226,7 +228,7 @@ namespace ICSharpCode.NRefactory.Visitors
}
}
TypedValue EvaluateAs(INode expression, DebugType type)
TypedValue EvaluateAs(AstNode expression, DebugType type)
{
TypedValue val = Evaluate(expression);
if (val.Type == type)
@ -249,7 +251,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -249,7 +251,7 @@ namespace ICSharpCode.NRefactory.Visitors
}
}
Value[] GetValues(List<TypedValue> typedVals)
Value[] GetValues(IList<TypedValue> typedVals)
{
List<Value> vals = new List<Value>(typedVals.Count);
foreach(TypedValue typedVal in typedVals) {
@ -258,7 +260,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -258,7 +260,7 @@ namespace ICSharpCode.NRefactory.Visitors
return vals.ToArray();
}
DebugType[] GetTypes(List<TypedValue> typedVals)
DebugType[] GetTypes(IList<TypedValue> typedVals)
{
List<DebugType> types = new List<DebugType>(typedVals.Count);
foreach(TypedValue typedVal in typedVals) {
@ -276,22 +278,22 @@ namespace ICSharpCode.NRefactory.Visitors @@ -276,22 +278,22 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
{
BinaryOperatorType op;
switch (assignmentExpression.Op) {
case AssignmentOperatorType.Assign: op = BinaryOperatorType.None; break;
switch (assignmentExpression.Operator) {
//case AssignmentOperatorType.Assign: op = BinaryOperatorType.None; break;
case AssignmentOperatorType.Add: op = BinaryOperatorType.Add; break;
case AssignmentOperatorType.ConcatString: op = BinaryOperatorType.Concat; break;
//case AssignmentOperatorType.ConcatString: op = BinaryOperatorType.Concat; break;
case AssignmentOperatorType.Subtract: op = BinaryOperatorType.Subtract; break;
case AssignmentOperatorType.Multiply: op = BinaryOperatorType.Multiply; break;
case AssignmentOperatorType.Divide: op = BinaryOperatorType.Divide; break;
case AssignmentOperatorType.DivideInteger: op = BinaryOperatorType.DivideInteger; break;
//case AssignmentOperatorType.DivideInteger: op = BinaryOperatorType.DivideInteger; break;
case AssignmentOperatorType.ShiftLeft: op = BinaryOperatorType.ShiftLeft; break;
case AssignmentOperatorType.ShiftRight: op = BinaryOperatorType.ShiftRight; break;
case AssignmentOperatorType.ExclusiveOr: op = BinaryOperatorType.ExclusiveOr; break;
case AssignmentOperatorType.Modulus: op = BinaryOperatorType.Modulus; break;
case AssignmentOperatorType.BitwiseAnd: op = BinaryOperatorType.BitwiseAnd; break;
case AssignmentOperatorType.BitwiseOr: op = BinaryOperatorType.BitwiseOr; break;
case AssignmentOperatorType.Power: op = BinaryOperatorType.Power; break;
default: throw new GetValueException("Unknown operator " + assignmentExpression.Op);
//case AssignmentOperatorType.Power: op = BinaryOperatorType.Power; break;
default: throw new GetValueException("Unknown operator " + assignmentExpression.Operator);
}
TypedValue right;
@ -300,7 +302,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -300,7 +302,7 @@ namespace ICSharpCode.NRefactory.Visitors
} else {
BinaryOperatorExpression binOpExpr = new BinaryOperatorExpression();
binOpExpr.Left = assignmentExpression.Left;
binOpExpr.Op = op;
binOpExpr.Operator = op;
binOpExpr.Right = assignmentExpression.Right;
right = Evaluate(binOpExpr);
}
@ -321,7 +323,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -321,7 +323,7 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitBlockStatement(BlockStatement blockStatement, object data)
{
foreach(INode statement in blockStatement.Children) {
foreach(var statement in blockStatement.Children) {
Evaluate(statement);
}
return null;
@ -341,7 +343,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -341,7 +343,7 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitCastExpression(CastExpression castExpression, object data)
{
TypedValue val = Evaluate(castExpression.Expression);
DebugType castTo = castExpression.CastTo.ResolveType(context.AppDomain);
DebugType castTo = castExpression.ResolveType(context.AppDomain).CastTo();
if (castTo.IsPrimitive && val.Type.IsPrimitive && castTo != val.Type) {
object oldVal = val.PrimitiveValue;
object newVal;
@ -403,11 +405,11 @@ namespace ICSharpCode.NRefactory.Visitors @@ -403,11 +405,11 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitIndexerExpression(IndexerExpression indexerExpression, object data)
{
TypedValue target = Evaluate(indexerExpression.TargetObject);
TypedValue target = Evaluate(indexerExpression.Target);
if (target.Type.IsArray) {
List<int> intIndexes = new List<int>();
foreach(Expression indexExpr in indexerExpression.Indexes) {
foreach(Expression indexExpr in indexerExpression.Arguments) {
intIndexes.Add(EvaluateAsInt(indexExpr));
}
return new TypedValue(
@ -415,16 +417,16 @@ namespace ICSharpCode.NRefactory.Visitors @@ -415,16 +417,16 @@ namespace ICSharpCode.NRefactory.Visitors
(DebugType)target.Type.GetElementType()
);
} else if (target.Type.FullName == typeof(string).FullName) {
if (indexerExpression.Indexes.Count != 1)
if (indexerExpression.Arguments.Count() != 1)
throw new GetValueException("Single index expected");
int index = EvaluateAsInt(indexerExpression.Indexes[0]);
int index = EvaluateAsInt(indexerExpression.Arguments.First());
string str = (string)target.PrimitiveValue;
if (index < 0 || index >= str.Length)
throw new GetValueException("Index was outside the bounds of the array.");
return CreateValue(str[index]);
} else {
List<TypedValue> indexes = EvaluateAll(indexerExpression.Indexes);
var indexes = EvaluateAll(indexerExpression.Arguments);
DebugPropertyInfo pi = (DebugPropertyInfo)target.Type.GetProperty("Item", GetTypes(indexes));
if (pi == null)
throw new GetValueException("The object does not have an indexer property");
@ -440,21 +442,21 @@ namespace ICSharpCode.NRefactory.Visitors @@ -440,21 +442,21 @@ namespace ICSharpCode.NRefactory.Visitors
TypedValue target;
DebugType targetType;
string methodName;
MemberReferenceExpression memberRef = invocationExpression.TargetObject as MemberReferenceExpression;
MemberReferenceExpression memberRef = invocationExpression.Target as MemberReferenceExpression;
if (memberRef != null) {
// TODO: Optimize
try {
// Instance
target = Evaluate(memberRef.TargetObject);
target = Evaluate(memberRef.Target);
targetType = target.Type;
} catch (GetValueException) {
// Static
target = null;
targetType = memberRef.TargetObject.ResolveType(context.AppDomain);
targetType = memberRef.Target.ResolveType(context.AppDomain);
}
methodName = memberRef.MemberName;
} else {
IdentifierExpression ident = invocationExpression.TargetObject as IdentifierExpression;
IdentifierExpression ident = invocationExpression.Target as IdentifierExpression;
if (ident != null) {
target = Evaluate(new ThisReferenceExpression());
targetType = target.Type;
@ -463,7 +465,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -463,7 +465,7 @@ namespace ICSharpCode.NRefactory.Visitors
throw new GetValueException("Member reference expected for method invocation");
}
}
List<TypedValue> args = EvaluateAll(invocationExpression.Arguments);
var args = EvaluateAll(invocationExpression.Arguments);
MethodInfo method = targetType.GetMethod(methodName, DebugType.BindingFlagsAllInScope, null, GetTypes(args), null);
if (method == null)
throw new GetValueException("Method " + methodName + " not found");
@ -475,11 +477,11 @@ namespace ICSharpCode.NRefactory.Visitors @@ -475,11 +477,11 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data)
{
if (!objectCreateExpression.ObjectInitializer.IsNull)
throw new EvaluateException(objectCreateExpression.ObjectInitializer, "Object initializers not supported");
if (!objectCreateExpression.Initializer.IsNull)
throw new EvaluateException(objectCreateExpression.Initializer, "Object initializers not supported");
DebugType type = objectCreateExpression.CreateType.ResolveType(context.AppDomain);
List<TypedValue> ctorArgs = EvaluateAll(objectCreateExpression.Parameters);
DebugType type = objectCreateExpression.Type.ResolveType(context.AppDomain);
var ctorArgs = EvaluateAll(objectCreateExpression.Arguments);
ConstructorInfo ctor = type.GetConstructor(BindingFlags.Default, null, CallingConventions.Any, GetTypes(ctorArgs), null);
if (ctor == null)
throw new EvaluateException(objectCreateExpression, "Constructor not found");
@ -489,24 +491,26 @@ namespace ICSharpCode.NRefactory.Visitors @@ -489,24 +491,26 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data)
{
if (arrayCreateExpression.CreateType.RankSpecifier[0] != 0)
if (arrayCreateExpression.Initializer.RankSpecifier[0] != 0)
throw new EvaluateException(arrayCreateExpression, "Multi-dimensional arrays are not suppored");
DebugType type = arrayCreateExpression.CreateType.ResolveType(context.AppDomain);
int length = 0;
if (arrayCreateExpression.Arguments.Count == 1) {
length = EvaluateAsInt(arrayCreateExpression.Arguments[0]);
} else if (!arrayCreateExpression.ArrayInitializer.IsNull) {
length = arrayCreateExpression.ArrayInitializer.CreateExpressions.Count;
if (arrayCreateExpression.Arguments.Count() == 1) {
length = EvaluateAsInt(arrayCreateExpression.Arguments.First());
} else if (!arrayCreateExpression.Initializer.IsNull) {
length = arrayCreateExpression.Initializer.Elements.Count();
}
Value array = Eval.NewArray((DebugType)type.GetElementType(), (uint)length, null);
if (!arrayCreateExpression.ArrayInitializer.IsNull) {
List<Expression> inits = arrayCreateExpression.ArrayInitializer.CreateExpressions;
if (inits.Count != length)
if (!arrayCreateExpression.Initializer.IsNull) {
var inits = arrayCreateExpression.Initializer.Elements;
if (inits.Count() != length)
throw new EvaluateException(arrayCreateExpression, "Incorrect initializer length");
for(int i = 0; i < length; i++) {
TypedValue init = EvaluateAs(inits[i], (DebugType)type.GetElementType());
array.SetArrayElement(new int[] { i }, init.Value);
int i = 0;
var enumerator = inits.GetEnumerator();
while (enumerator.MoveNext()) {
TypedValue init = EvaluateAs(enumerator.Current, (DebugType)type.GetElementType());
array.SetArrayElement(new int[] { i++ }, init.Value);
}
}
return new TypedValue(array, type);
@ -518,13 +522,13 @@ namespace ICSharpCode.NRefactory.Visitors @@ -518,13 +522,13 @@ namespace ICSharpCode.NRefactory.Visitors
DebugType targetType;
try {
// Instance
target = Evaluate(memberReferenceExpression.TargetObject);
target = Evaluate(memberReferenceExpression.Target);
targetType = target.Type;
} catch (GetValueException e) {
// Static
target = null;
try {
targetType = memberReferenceExpression.TargetObject.ResolveType(context.AppDomain);
targetType = memberReferenceExpression.Target.ResolveType(context.AppDomain);
} catch (GetValueException) {
throw e; // Use the other, nicer message
}
@ -570,7 +574,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -570,7 +574,7 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data)
{
TypedValue value = Evaluate(unaryOperatorExpression.Expression);
UnaryOperatorType op = unaryOperatorExpression.Op;
UnaryOperatorType op = unaryOperatorExpression.Operator;
if (op == UnaryOperatorType.Dereference) {
if (!value.Type.IsPointer)
@ -588,9 +592,9 @@ namespace ICSharpCode.NRefactory.Visitors @@ -588,9 +592,9 @@ namespace ICSharpCode.NRefactory.Visitors
TypedValue newValue = null;
try {
if (op == UnaryOperatorType.Decrement || op == UnaryOperatorType.PostDecrement)
newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Subtract, new PrimitiveExpression(1)), null);
newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Subtract), null);
if (op == UnaryOperatorType.Increment || op == UnaryOperatorType.PostIncrement)
newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Add, new PrimitiveExpression(1)), null);
newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Add), null);
} catch (EvaluateException e) {
throw new EvaluateException(unaryOperatorExpression, e.Message);
}
@ -714,7 +718,7 @@ namespace ICSharpCode.NRefactory.Visitors @@ -714,7 +718,7 @@ namespace ICSharpCode.NRefactory.Visitors
public object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data)
{
BinaryOperatorType op = binaryOperatorExpression.Op;
BinaryOperatorType op = binaryOperatorExpression.Operator;
TypedValue left = Evaluate(binaryOperatorExpression.Left);
TypedValue right = Evaluate(binaryOperatorExpression.Right);
@ -849,8 +853,8 @@ namespace ICSharpCode.NRefactory.Visitors @@ -849,8 +853,8 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.ExclusiveOr: return a ^ b;
case BinaryOperatorType.BitwiseAnd: return a & b;
case BinaryOperatorType.BitwiseOr: return a | b;
case BinaryOperatorType.LogicalAnd: return a && b;
case BinaryOperatorType.LogicalOr: return a || b;
case BinaryOperatorType.ConditionalAnd: return a && b;
case BinaryOperatorType.ConditionalOr: return a || b;
}
}
@ -870,7 +874,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -870,7 +874,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}
@ -890,7 +893,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -890,7 +893,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}
@ -918,7 +920,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -918,7 +920,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}
@ -946,7 +947,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -946,7 +947,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}
@ -974,7 +974,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -974,7 +974,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}
@ -1002,7 +1001,6 @@ namespace ICSharpCode.NRefactory.Visitors @@ -1002,7 +1001,6 @@ namespace ICSharpCode.NRefactory.Visitors
case BinaryOperatorType.Multiply: return a * b;
case BinaryOperatorType.Divide: return a / b;
case BinaryOperatorType.Modulus: return a % b;
case BinaryOperatorType.Concat: return a + b;
}
}

4
Debugger/Debugger.Core/Process.cs

@ -7,7 +7,7 @@ using System.Runtime.InteropServices; @@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
using Debugger.Interop.CorDebug;
using Debugger.Interop.CorSym;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.Visitors;
namespace Debugger
@ -258,7 +258,7 @@ namespace Debugger @@ -258,7 +258,7 @@ namespace Debugger
internal bool TerminateCommandIssued = false;
internal Queue<Breakpoint> BreakpointHitEventQueue = new Queue<Breakpoint>();
internal Dictionary<INode, TypedValue> ExpressionsCache = new Dictionary<INode, TypedValue>();
internal Dictionary<AstNode, TypedValue> ExpressionsCache = new Dictionary<AstNode, TypedValue>();
#region Events

4
Debugger/ILSpy.Debugger/AvalonEdit/Editor/IDocument.cs

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using Mono.CSharp;
using ICSharpCode.NRefactory.CSharp;
namespace ILSpy.Debugger.AvalonEdit.Editor
{
@ -50,7 +50,7 @@ namespace ILSpy.Debugger.AvalonEdit.Editor @@ -50,7 +50,7 @@ namespace ILSpy.Debugger.AvalonEdit.Editor
IDocumentLine GetLineForOffset(int offset);
int PositionToOffset(int line, int column);
Location OffsetToPosition(int offset);
AstLocation OffsetToPosition(int offset);
void Insert(int offset, string text);
void Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType);

4
Debugger/ILSpy.Debugger/AvalonEdit/Editor/ITextAnchor.cs

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using Mono.CSharp;
using ICSharpCode.NRefactory.CSharp;
namespace ILSpy.Debugger.AvalonEdit.Editor
{
@ -30,7 +30,7 @@ namespace ILSpy.Debugger.AvalonEdit.Editor @@ -30,7 +30,7 @@ namespace ILSpy.Debugger.AvalonEdit.Editor
/// Gets the text location of this anchor.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown when trying to get the Offset from a deleted anchor.</exception>
Location Location { get; }
AstLocation Location { get; }
/// <summary>
/// Gets the offset of the text anchor.

14
Debugger/ILSpy.Debugger/Bookmarks/BookmarkBase.cs

@ -20,8 +20,8 @@ using System; @@ -20,8 +20,8 @@ using System;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.NRefactory.CSharp;
using ILSpy.Debugger.AvalonEdit.Editor;
using Mono.CSharp;
namespace ILSpy.Debugger.Bookmarks
{
@ -30,7 +30,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -30,7 +30,7 @@ namespace ILSpy.Debugger.Bookmarks
/// </summary>
public class BookmarkBase : IBookmark
{
Location location;
AstLocation location;
IDocument document;
ITextAnchor anchor;
@ -55,7 +55,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -55,7 +55,7 @@ namespace ILSpy.Debugger.Bookmarks
void CreateAnchor()
{
if (document != null) {
int lineNumber = Math.Max(1, Math.Min(location.Row, document.TotalNumberOfLines));
int lineNumber = Math.Max(1, Math.Min(location.Line, document.TotalNumberOfLines));
int lineLength = document.GetLine(lineNumber).Length;
int offset = document.PositionToOffset(
lineNumber,
@ -73,7 +73,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -73,7 +73,7 @@ namespace ILSpy.Debugger.Bookmarks
void AnchorDeleted(object sender, EventArgs e)
{
// the anchor just became invalid, so don't try to use it again
location = Location.Null;
location = AstLocation.Empty;
anchor = null;
RemoveMark();
}
@ -91,7 +91,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -91,7 +91,7 @@ namespace ILSpy.Debugger.Bookmarks
get { return anchor; }
}
public Location Location {
public AstLocation Location {
get {
if (anchor != null)
return anchor.Location;
@ -125,7 +125,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -125,7 +125,7 @@ namespace ILSpy.Debugger.Bookmarks
if (anchor != null)
return anchor.Line;
else
return location.Row;
return location.Line;
}
}
@ -151,7 +151,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -151,7 +151,7 @@ namespace ILSpy.Debugger.Bookmarks
}
}
public BookmarkBase(string typeName, Location location)
public BookmarkBase(string typeName, AstLocation location)
{
this.TypeName = typeName;
this.Location = location;

5
Debugger/ILSpy.Debugger/Bookmarks/BookmarkManager.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.CSharp;
using Mono.CSharp;
namespace ILSpy.Debugger.Bookmarks
@ -109,7 +110,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -109,7 +110,7 @@ namespace ILSpy.Debugger.Bookmarks
public static void ToggleBookmark(string typeName, int line,
Predicate<BookmarkBase> canToggle,
Func<Location, BookmarkBase> bookmarkFactory)
Func<AstLocation, BookmarkBase> bookmarkFactory)
{
foreach (BookmarkBase bookmark in GetBookmarks(typeName)) {
if (canToggle(bookmark) && bookmark.LineNumber == line) {
@ -118,7 +119,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -118,7 +119,7 @@ namespace ILSpy.Debugger.Bookmarks
}
}
// no bookmark at that line: create a new bookmark
BookmarkManager.AddMark(bookmarkFactory(new Location(0, line)));
BookmarkManager.AddMark(bookmarkFactory(new AstLocation(0, line)));
}
public static event BookmarkEventHandler Removed;

4
Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs

@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
using System;
using System.Windows.Media;
using ICSharpCode.NRefactory.CSharp;
using ILSpy.Debugger.Services;
using Mono.CSharp;
namespace ILSpy.Debugger.Bookmarks
{
@ -83,7 +83,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -83,7 +83,7 @@ namespace ILSpy.Debugger.Bookmarks
set { tooltip = value; }
}
public BreakpointBookmark(string typeName, Location location, BreakpointAction action) : base(typeName, location)
public BreakpointBookmark(string typeName, AstLocation location, BreakpointAction action) : base(typeName, location)
{
this.action = action;
}

5
Debugger/ILSpy.Debugger/Bookmarks/CurrentLineBookmark.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Windows.Media;
using ICSharpCode.NRefactory.CSharp;
using ILSpy.Debugger.Services;
using Mono.CSharp;
@ -26,7 +27,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -26,7 +27,7 @@ namespace ILSpy.Debugger.Bookmarks
endLine = makerEndLine;
endColumn = makerEndColumn;
instance = new CurrentLineBookmark(typeName, new Location(startColumn, startLine));
instance = new CurrentLineBookmark(typeName, new AstLocation(startColumn, startLine));
BookmarkManager.AddMark(instance);
}
@ -46,7 +47,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -46,7 +47,7 @@ namespace ILSpy.Debugger.Bookmarks
get { return 100; }
}
public CurrentLineBookmark(string typeName, Location location) : base(typeName, location)
public CurrentLineBookmark(string typeName, AstLocation location) : base(typeName, location)
{
}

1
Debugger/ILSpy.Debugger/ILSpy.Debugger.csproj

@ -93,7 +93,6 @@ @@ -93,7 +93,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Models\TreeModel" />
<Folder Include="Services\Debugger\Tooltips" />
</ItemGroup>
<ItemGroup>
<Page Include="UI\AttachToProcessWindow.xaml" />

3
Debugger/ILSpy.Debugger/Services/Debugger/IDebugger.cs

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
using Mono.CSharp;
namespace ILSpy.Debugger.Services
@ -79,7 +80,7 @@ namespace ILSpy.Debugger.Services @@ -79,7 +80,7 @@ namespace ILSpy.Debugger.Services
/// Gets the tooltip control that shows the value of given variable.
/// Return null if no tooltip is available.
/// </summary>
object GetTooltipControl(Location logicalPosition, string variable);
object GetTooltipControl(AstLocation logicalPosition, string variable);
/// <summary>
/// Queries the debugger whether it is possible to set the instruction pointer to a given position.

5
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -10,11 +10,12 @@ using System.Windows.Media; @@ -10,11 +10,12 @@ using System.Windows.Media;
using Debugger;
using Debugger.Interop.CorPublish;
using ICSharpCode.Decompiler.Disassembler;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.Visitors;
using ILSpy.Debugger.Bookmarks;
using ILSpy.Debugger.Models.TreeModel;
using ILSpy.Debugger.Services.Debugger;
using Mono.CSharp;
using CorDbg = Debugger;
using Process = Debugger.Process;
@ -381,7 +382,7 @@ namespace ILSpy.Debugger.Services @@ -381,7 +382,7 @@ namespace ILSpy.Debugger.Services
/// Gets the tooltip control that shows the value of given variable.
/// Return null if no tooltip is available.
/// </summary>
public object GetTooltipControl(Location logicalPosition, string variableName)
public object GetTooltipControl(AstLocation logicalPosition, string variableName)
{
try {
var tooltipExpression = GetExpression(variableName);

20
ILSpy.sln

@ -1,7 +1,15 @@ @@ -1,7 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.1.0.7279-alpha
# SharpDevelop 4.1.0.7302-alpha
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugger", "Debugger", "{1DEB3B4E-03AC-437C-821D-B09FBFCC3E5B}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Debugger", "Debugger\ILSpy.Debugger\ILSpy.Debugger.csproj", "{6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger.Core", "Debugger\Debugger.Core\Debugger.Core.csproj", "{1D18D788-F7EE-4585-A23B-34DC8EC63CB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy", "ILSpy\ILSpy.csproj", "{1E85EFF9-E370-4683-83E4-8A3D063FF791}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TreeView", "SharpTreeView\ICSharpCode.TreeView.csproj", "{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}"
@ -14,14 +22,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Decompiler", "I @@ -14,14 +22,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Decompiler", "I
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory", "NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj", "{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugger", "Debugger", "{1DEB3B4E-03AC-437C-821D-B09FBFCC3E5B}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger.Core", "Debugger\Debugger.Core\Debugger.Core.csproj", "{1D18D788-F7EE-4585-A23B-34DC8EC63CB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Debugger", "Debugger\ILSpy.Debugger\ILSpy.Debugger.csproj", "{6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
@ -96,7 +96,7 @@ Global @@ -96,7 +96,7 @@ Global
{6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}.Release|Any CPU.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A} = {1DEB3B4E-03AC-437C-821D-B09FBFCC3E5B}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {1DEB3B4E-03AC-437C-821D-B09FBFCC3E5B}
{6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A} = {1DEB3B4E-03AC-437C-821D-B09FBFCC3E5B}
EndGlobalSection
EndGlobal

510
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/NotImplementedAstVisitor.cs

@ -0,0 +1,510 @@ @@ -0,0 +1,510 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.NRefactory.CSharp
{
public class NotImplementedAstVisitor<T, S> : AstVisitor<T, S>
{
public S VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, T data)
{
throw new NotImplementedException();
}
public S VisitArgListExpression(ArgListExpression argListExpression, T data)
{
throw new NotImplementedException();
}
public S VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, T data)
{
throw new NotImplementedException();
}
public S VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, T data)
{
throw new NotImplementedException();
}
public S VisitAsExpression(AsExpression asExpression, T data)
{
throw new NotImplementedException();
}
public S VisitAssignmentExpression(AssignmentExpression assignmentExpression, T data)
{
throw new NotImplementedException();
}
public S VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, T data)
{
throw new NotImplementedException();
}
public S VisitCastExpression(CastExpression castExpression, T data)
{
throw new NotImplementedException();
}
public S VisitCheckedExpression(CheckedExpression checkedExpression, T data)
{
throw new NotImplementedException();
}
public S VisitConditionalExpression(ConditionalExpression conditionalExpression, T data)
{
throw new NotImplementedException();
}
public S VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, T data)
{
throw new NotImplementedException();
}
public S VisitDirectionExpression(DirectionExpression directionExpression, T data)
{
throw new NotImplementedException();
}
public S VisitIdentifierExpression(IdentifierExpression identifierExpression, T data)
{
throw new NotImplementedException();
}
public S VisitIndexerExpression(IndexerExpression indexerExpression, T data)
{
throw new NotImplementedException();
}
public S VisitInvocationExpression(InvocationExpression invocationExpression, T data)
{
throw new NotImplementedException();
}
public S VisitIsExpression(IsExpression isExpression, T data)
{
throw new NotImplementedException();
}
public S VisitLambdaExpression(LambdaExpression lambdaExpression, T data)
{
throw new NotImplementedException();
}
public S VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, T data)
{
throw new NotImplementedException();
}
public S VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, T data)
{
throw new NotImplementedException();
}
public S VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, T data)
{
throw new NotImplementedException();
}
public S VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data)
{
throw new NotImplementedException();
}
public S VisitSizeOfExpression(SizeOfExpression sizeOfExpression, T data)
{
throw new NotImplementedException();
}
public S VisitStackAllocExpression(StackAllocExpression stackAllocExpression, T data)
{
throw new NotImplementedException();
}
public S VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitTypeOfExpression(TypeOfExpression typeOfExpression, T data)
{
throw new NotImplementedException();
}
public S VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, T data)
{
throw new NotImplementedException();
}
public S VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, T data)
{
throw new NotImplementedException();
}
public S VisitUncheckedExpression(UncheckedExpression uncheckedExpression, T data)
{
throw new NotImplementedException();
}
public S VisitQueryExpression(QueryExpression queryExpression, T data)
{
throw new NotImplementedException();
}
public S VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryFromClause(QueryFromClause queryFromClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryLetClause(QueryLetClause queryLetClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryWhereClause(QueryWhereClause queryWhereClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryJoinClause(QueryJoinClause queryJoinClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryOrderClause(QueryOrderClause queryOrderClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryOrdering(QueryOrdering queryOrdering, T data)
{
throw new NotImplementedException();
}
public S VisitQuerySelectClause(QuerySelectClause querySelectClause, T data)
{
throw new NotImplementedException();
}
public S VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data)
{
throw new NotImplementedException();
}
public S VisitAttribute(Attribute attribute, T data)
{
throw new NotImplementedException();
}
public S VisitAttributeSection(AttributeSection attributeSection, T data)
{
throw new NotImplementedException();
}
public S VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitTypeDeclaration(TypeDeclaration typeDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitUsingDeclaration(UsingDeclaration usingDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitBlockStatement(BlockStatement blockStatement, T data)
{
throw new NotImplementedException();
}
public S VisitBreakStatement(BreakStatement breakStatement, T data)
{
throw new NotImplementedException();
}
public S VisitCheckedStatement(CheckedStatement checkedStatement, T data)
{
throw new NotImplementedException();
}
public S VisitContinueStatement(ContinueStatement continueStatement, T data)
{
throw new NotImplementedException();
}
public S VisitEmptyStatement(EmptyStatement emptyStatement, T data)
{
throw new NotImplementedException();
}
public S VisitExpressionStatement(ExpressionStatement expressionStatement, T data)
{
throw new NotImplementedException();
}
public S VisitFixedStatement(FixedStatement fixedStatement, T data)
{
throw new NotImplementedException();
}
public S VisitForeachStatement(ForeachStatement foreachStatement, T data)
{
throw new NotImplementedException();
}
public S VisitForStatement(ForStatement forStatement, T data)
{
throw new NotImplementedException();
}
public S VisitGotoStatement(GotoStatement gotoStatement, T data)
{
throw new NotImplementedException();
}
public S VisitIfElseStatement(IfElseStatement ifElseStatement, T data)
{
throw new NotImplementedException();
}
public S VisitLabelStatement(LabelStatement labelStatement, T data)
{
throw new NotImplementedException();
}
public S VisitLockStatement(LockStatement lockStatement, T data)
{
throw new NotImplementedException();
}
public S VisitReturnStatement(ReturnStatement returnStatement, T data)
{
throw new NotImplementedException();
}
public S VisitSwitchStatement(SwitchStatement switchStatement, T data)
{
throw new NotImplementedException();
}
public S VisitSwitchSection(SwitchSection switchSection, T data)
{
throw new NotImplementedException();
}
public S VisitCaseLabel(CaseLabel caseLabel, T data)
{
throw new NotImplementedException();
}
public S VisitThrowStatement(ThrowStatement throwStatement, T data)
{
throw new NotImplementedException();
}
public S VisitTryCatchStatement(TryCatchStatement tryCatchStatement, T data)
{
throw new NotImplementedException();
}
public S VisitCatchClause(CatchClause catchClause, T data)
{
throw new NotImplementedException();
}
public S VisitUncheckedStatement(UncheckedStatement uncheckedStatement, T data)
{
throw new NotImplementedException();
}
public S VisitUnsafeStatement(UnsafeStatement unsafeStatement, T data)
{
throw new NotImplementedException();
}
public S VisitUsingStatement(UsingStatement usingStatement, T data)
{
throw new NotImplementedException();
}
public S VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, T data)
{
throw new NotImplementedException();
}
public S VisitWhileStatement(WhileStatement whileStatement, T data)
{
throw new NotImplementedException();
}
public S VisitYieldStatement(YieldStatement yieldStatement, T data)
{
throw new NotImplementedException();
}
public S VisitAccessor(Accessor accessor, T data)
{
throw new NotImplementedException();
}
public S VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitConstructorInitializer(ConstructorInitializer constructorInitializer, T data)
{
throw new NotImplementedException();
}
public S VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitEventDeclaration(EventDeclaration eventDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitFieldDeclaration(FieldDeclaration fieldDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitMethodDeclaration(MethodDeclaration methodDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitParameterDeclaration(ParameterDeclaration parameterDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitVariableInitializer(VariableInitializer variableInitializer, T data)
{
throw new NotImplementedException();
}
public S VisitCompilationUnit(CompilationUnit compilationUnit, T data)
{
throw new NotImplementedException();
}
public S VisitSimpleType(SimpleType simpleType, T data)
{
throw new NotImplementedException();
}
public S VisitMemberType(MemberType memberType, T data)
{
throw new NotImplementedException();
}
public S VisitComposedType(ComposedType composedType, T data)
{
throw new NotImplementedException();
}
public S VisitArraySpecifier(ArraySpecifier arraySpecifier, T data)
{
throw new NotImplementedException();
}
public S VisitPrimitiveType(PrimitiveType primitiveType, T data)
{
throw new NotImplementedException();
}
public S VisitComment(Comment comment, T data)
{
throw new NotImplementedException();
}
public S VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration, T data)
{
throw new NotImplementedException();
}
public S VisitConstraint(Constraint constraint, T data)
{
throw new NotImplementedException();
}
public S VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode, T data)
{
throw new NotImplementedException();
}
public S VisitIdentifier(Identifier identifier, T data)
{
throw new NotImplementedException();
}
}
}

2
NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

@ -95,6 +95,7 @@ @@ -95,6 +95,7 @@
<Compile Include="CSharp\Ast\Expressions\UncheckedExpression.cs" />
<Compile Include="CSharp\Ast\GeneralScope\TypeParameterDeclaration.cs" />
<Compile Include="CSharp\Ast\MemberType.cs" />
<Compile Include="CSharp\Ast\NotImplementedAstVisitor.cs" />
<Compile Include="CSharp\Ast\PrimitiveType.cs" />
<Compile Include="CSharp\Ast\GeneralScope\Attribute.cs" />
<Compile Include="CSharp\Ast\GeneralScope\AttributeSection.cs" />
@ -189,6 +190,7 @@ @@ -189,6 +190,7 @@
<Compile Include="Documentation\BinaryDocumentationProvider.cs" />
<Compile Include="Documentation\XmlDocumentationProvider.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SupportedLanguage.cs" />
<Compile Include="TypeSystem\Accessibility.cs" />
<Compile Include="TypeSystem\ArrayType.cs" />
<Compile Include="TypeSystem\ByReferenceType.cs" />

12
NRefactory/ICSharpCode.NRefactory/SupportedLanguage.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) 2010 AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.NRefactory
{
public enum SupportedLanguage {
CSharp,
//VBNet
}
}
Loading…
Cancel
Save