Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2765 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 61 additions and 240 deletions
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
using Ast = ICSharpCode.NRefactory.Ast; |
||||
|
||||
using Debugger.Wrappers.CorDebug; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
/// <summary>
|
||||
/// Represents an element of an array
|
||||
/// </summary>
|
||||
public class ArrayElement: Value |
||||
{ |
||||
uint[] indicies; |
||||
|
||||
/// <summary>
|
||||
/// The indicies of the element; one for each dimension of
|
||||
/// the array.
|
||||
/// </summary>
|
||||
public uint[] Indicies { |
||||
get { |
||||
return indicies; |
||||
} |
||||
} |
||||
|
||||
internal ArrayElement(uint[] indicies, |
||||
Process process, |
||||
IExpirable[] expireDependencies, |
||||
IMutable[] mutateDependencies, |
||||
CorValueGetter corValueGetter) |
||||
:base (process, |
||||
GetNameFromIndices(indicies), |
||||
GetExpressionFromIndices(indicies), |
||||
expireDependencies, |
||||
mutateDependencies, |
||||
corValueGetter) |
||||
{ |
||||
this.indicies = indicies; |
||||
} |
||||
|
||||
static string GetNameFromIndices(uint[] indices) |
||||
{ |
||||
string elementName = "["; |
||||
for (int i = 0; i < indices.Length; i++) { |
||||
elementName += indices[i].ToString() + ","; |
||||
} |
||||
elementName = elementName.TrimEnd(new char[] {','}) + "]"; |
||||
return elementName; |
||||
} |
||||
|
||||
static Expression GetExpressionFromIndices(uint[] indices) |
||||
{ |
||||
List<Ast.Expression> indicesAst = new List<Ast.Expression>(); |
||||
foreach(uint indice in indices) { |
||||
indicesAst.Add(new Ast.PrimitiveExpression(indice, indice.ToString())); |
||||
} |
||||
return new Ast.IndexerExpression( |
||||
new Ast.IdentifierExpression("parent"), // TODO
|
||||
indicesAst |
||||
); |
||||
} |
||||
} |
||||
} |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
using Debugger.Wrappers.CorDebug; |
||||
|
||||
using Ast = ICSharpCode.NRefactory.Ast; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
/// <summary>
|
||||
/// Represents a local variable in a function
|
||||
/// </summary>
|
||||
public class LocalVariable: Value |
||||
{ |
||||
internal LocalVariable(string name, |
||||
Process process, |
||||
IExpirable[] expireDependencies, |
||||
IMutable[] mutateDependencies, |
||||
CorValueGetter corValueGetter) |
||||
:base (process, |
||||
name, |
||||
new Ast.IdentifierExpression(name), |
||||
expireDependencies, |
||||
mutateDependencies, |
||||
corValueGetter) |
||||
{ |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
using Debugger.Wrappers.CorDebug; |
||||
|
||||
using Ast = ICSharpCode.NRefactory.Ast; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
/// <summary>
|
||||
/// Represents a member of class or value type -
|
||||
/// that is, a field or a property
|
||||
/// </summary>
|
||||
public class MemberValue: Value |
||||
{ |
||||
MemberInfo memberInfo; |
||||
|
||||
/// <summary>
|
||||
/// Gets an MemberInfo object which can be used to obtain
|
||||
/// metadata information about the member.
|
||||
/// </summary>
|
||||
public MemberInfo MemberInfo { |
||||
get { |
||||
return memberInfo; |
||||
} |
||||
} |
||||
|
||||
internal MemberValue(MemberInfo memberInfo, |
||||
Process process, |
||||
IExpirable[] expireDependencies, |
||||
IMutable[] mutateDependencies, |
||||
CorValueGetter corValueGetter) |
||||
:base (process, |
||||
memberInfo.Name, |
||||
new Ast.MemberReferenceExpression( |
||||
new Ast.IdentifierExpression("parent"), // TODO
|
||||
memberInfo.Name |
||||
), |
||||
expireDependencies, |
||||
mutateDependencies, |
||||
corValueGetter) |
||||
{ |
||||
this.memberInfo = memberInfo; |
||||
} |
||||
} |
||||
} |
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
using Debugger.Wrappers.CorDebug; |
||||
|
||||
using Ast = ICSharpCode.NRefactory.Ast; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
/// <summary>
|
||||
/// Represents an argument of a function. That is, it refers to
|
||||
/// the runtime value of function parameter.
|
||||
/// </summary>
|
||||
public class MethodArgument: Value |
||||
{ |
||||
int index; |
||||
|
||||
/// <summary>
|
||||
/// The index of the function parameter starting at 0.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The implicit 'this' is excluded.
|
||||
/// </remarks>
|
||||
public int Index { |
||||
get { |
||||
return index; |
||||
} |
||||
} |
||||
|
||||
internal MethodArgument(string name, |
||||
int index, |
||||
Process process, |
||||
IExpirable[] expireDependencies, |
||||
IMutable[] mutateDependencies, |
||||
CorValueGetter corValueGetter) |
||||
:base (process, |
||||
name, |
||||
new Ast.IdentifierExpression(name), |
||||
expireDependencies, |
||||
mutateDependencies, |
||||
corValueGetter) |
||||
{ |
||||
this.index = index; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue