diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs index ad639c6cfe..ca0814c808 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs @@ -440,7 +440,7 @@ namespace Debugger thisValueCache = new Value( process, "this", - ThisExpresson, + new Ast.ThisReferenceExpression(), new IExpirable[] {this}, new IMutable[] {}, delegate { return ThisCorValue; } @@ -450,12 +450,6 @@ namespace Debugger } } - static private Expression ThisExpresson { - get { - return new Expression(new ICSharpCode.NRefactory.Ast.ThisReferenceExpression()); - } - } - ICorDebugValue ThisCorValue { get { if (this.HasExpired) throw new CannotGetValueException("Function has expired"); diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs index 357643ca76..5fe3be108d 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs @@ -46,6 +46,15 @@ namespace Debugger return new Expression(expressionAst); } + public static implicit operator ICSharpCode.NRefactory.Ast.Expression(Expression expression) + { + if (expression == null) { + return null; + } else { + return expression.AbstractSynatxTree; + } + } + public override string ToString() { return this.Code; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs index 404386ed3a..97b56ab7ca 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs @@ -96,14 +96,14 @@ namespace Debugger return elementName; } - static Expression GetExpressionFromIndices(uint[] indices) + Expression GetExpressionFromIndices(uint[] indices) { List indicesAst = new List(); foreach(uint indice in indices) { - indicesAst.Add(new Ast.PrimitiveExpression(indice, indice.ToString())); + indicesAst.Add(new Ast.PrimitiveExpression((int)indice, ((int)indice).ToString())); } return new Ast.IndexerExpression( - new Ast.IdentifierExpression("parent"), // TODO + this.Expression, indicesAst ); } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs index 3d81c99b07..a3bec02441 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs @@ -53,7 +53,7 @@ namespace Debugger objectInstance.Process, fieldInfo.Name, new Ast.FieldReferenceExpression( - new Ast.IdentifierExpression("parent"), // TODO + objectInstance.Expression, fieldInfo ), new IExpirable[] {objectInstance}, @@ -121,7 +121,7 @@ namespace Debugger objectInstance.Process, propertyInfo.Name, new Ast.PropertyReferenceExpression( - new Ast.IdentifierExpression("parent"), // TODO + objectInstance.Expression, propertyInfo ), dependencies.ToArray(), diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml index 20d2216c83..50718409bc 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml @@ -39,7 +39,7 @@ [0] False 0 - parent[0u] + array[0] False System.Int32 @@ -55,7 +55,7 @@ [1] False 1 - parent[1u] + array[1] False System.Int32 @@ -71,7 +71,7 @@ [2] False 2 - parent[2u] + array[2] False System.Int32 @@ -87,7 +87,7 @@ [3] False 3 - parent[3u] + array[3] False System.Int32 @@ -103,7 +103,7 @@ [4] False 4 - parent[4u] + array[4] False System.Int32 diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml index 74a2d89de8..e6078531fd 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml @@ -54,7 +54,7 @@ class False 3 - parent.@class + this.@class False System.Int32 @@ -109,7 +109,7 @@ class False 3 - parent.@class + this.@class False System.Int32 @@ -182,7 +182,7 @@ class False 3 - parent.@class + this.@class False System.Int32 @@ -255,7 +255,7 @@ class False 3 - parent.@class + this.@class False System.Int32 @@ -346,7 +346,7 @@ class - parent.@class + this.@class True diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.xml index 7761379e6b..23f8ac22b5 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.xml +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.xml @@ -39,7 +39,7 @@ buckets False {System.Int32[]} - parent.buckets + dict.buckets False System.Int32[] @@ -55,7 +55,7 @@ entries False {Entry<System.String,System.Int32>[]} - parent.entries + dict.entries False Entry<System.String,System.Int32>[] @@ -71,7 +71,7 @@ count False 3 - parent.count + dict.count False System.Int32 @@ -87,7 +87,7 @@ version False 3 - parent.version + dict.version False System.Int32 @@ -103,7 +103,7 @@ freeList False -1 - parent.freeList + dict.freeList False System.Int32 @@ -119,7 +119,7 @@ freeCount False 0 - parent.freeCount + dict.freeCount False System.Int32 @@ -135,7 +135,7 @@ comparer False {System.Collections.Generic.GenericEqualityComparer<System.String>} - parent.comparer + dict.comparer False System.Collections.Generic.GenericEqualityComparer<System.String> @@ -151,7 +151,7 @@ keys True <null> - parent.keys + dict.keys False KeyCollection<System.String,System.Int32> @@ -167,7 +167,7 @@ values True <null> - parent.values + dict.values False ValueCollection<System.String,System.Int32> @@ -183,7 +183,7 @@ _syncRoot True <null> - parent._syncRoot + dict._syncRoot False System.Object @@ -199,7 +199,7 @@ m_siInfo True <null> - parent.m_siInfo + dict.m_siInfo False System.Runtime.Serialization.SerializationInfo @@ -215,7 +215,7 @@ Comparer False {System.TypeLoadException} - parent.Comparer + dict.Comparer False System.TypeLoadException @@ -231,7 +231,7 @@ Count False {System.TypeLoadException} - parent.Count + dict.Count False System.TypeLoadException @@ -247,7 +247,7 @@ Keys False {System.TypeLoadException} - parent.Keys + dict.Keys False System.TypeLoadException @@ -263,7 +263,7 @@ Values False {System.TypeLoadException} - parent.Values + dict.Values False System.TypeLoadException @@ -279,7 +279,7 @@ Item False {System.TypeLoadException} - parent.Item + dict.Item False System.TypeLoadException diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml index a5c54fe1d8..f79ecad664 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml @@ -39,7 +39,7 @@ privateField False private - parent.privateField + val.privateField False System.String @@ -55,7 +55,7 @@ publicFiled False public - parent.publicFiled + val.publicFiled False System.String @@ -71,7 +71,7 @@ PublicProperty False private - parent.PublicProperty + val.PublicProperty False System.String @@ -87,7 +87,7 @@ basePublic False a - parent.basePublic + val.basePublic False System.String @@ -103,7 +103,7 @@ basePrivate False b - parent.basePrivate + val.basePrivate False System.String @@ -146,7 +146,7 @@ privateField False new private - parent.privateField + val.privateField False System.String @@ -162,7 +162,7 @@ publicFiled False public - parent.publicFiled + val.publicFiled False System.String @@ -178,7 +178,7 @@ PublicProperty False new private - parent.PublicProperty + val.PublicProperty False System.String @@ -194,7 +194,7 @@ basePublic False a - parent.basePublic + val.basePublic False System.String @@ -210,7 +210,7 @@ basePrivate False b - parent.basePrivate + val.basePrivate False System.String