Browse Source

Fixed Forum-6652: Arrays make use of corHandleValue

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1286 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
e0c1f3ff64
  1. 29
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ArrayValue.cs

29
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ArrayValue.cs

@ -18,32 +18,36 @@ namespace Debugger
{ {
public class ArrayValue: Value public class ArrayValue: Value
{ {
ICorDebugArrayValue corArrayValue;
uint[] dimensions; uint[] dimensions;
uint lenght; uint lenght;
CorElementType corElementType; CorElementType corElementType;
readonly uint rank; readonly uint rank;
protected ICorDebugArrayValue CorArrayValue {
get {
return this.CorValue.CastTo<ICorDebugArrayValue>();
}
}
public uint Lenght { public uint Lenght {
get { get {
return lenght; return lenght;
} }
} }
public string ElementsType { public string ElementsType {
get { get {
return CorTypeToString(corElementType); return CorTypeToString(corElementType);
} }
} }
public uint Rank { public uint Rank {
get { get {
return rank; return rank;
} }
} }
public override string AsString { public override string AsString {
get { get {
string txt = "{" + ElementsType + "["; string txt = "{" + ElementsType + "[";
@ -57,15 +61,14 @@ namespace Debugger
internal unsafe ArrayValue(NDebugger debugger, ICorDebugValue corValue):base(debugger, corValue) internal unsafe ArrayValue(NDebugger debugger, ICorDebugValue corValue):base(debugger, corValue)
{ {
corArrayValue = this.CorValue.CastTo<ICorDebugArrayValue>(); corElementType = (CorElementType)CorArrayValue.ElementType;
corElementType = (CorElementType)corArrayValue.ElementType;
rank = corArrayValue.Rank; rank = CorArrayValue.Rank;
lenght = corArrayValue.Count; lenght = CorArrayValue.Count;
dimensions = new uint[rank]; dimensions = new uint[rank];
fixed (void* pDimensions = dimensions) fixed (void* pDimensions = dimensions)
corArrayValue.GetDimensions(rank, new IntPtr(pDimensions)); CorArrayValue.GetDimensions(rank, new IntPtr(pDimensions));
} }
@ -116,7 +119,7 @@ namespace Debugger
ICorDebugValue element; ICorDebugValue element;
unsafe { unsafe {
fixed (void* pIndices = indices) { fixed (void* pIndices = indices) {
element = updatedVal.corArrayValue.GetElement(rank, new IntPtr(pIndices)); element = updatedVal.CorArrayValue.GetElement(rank, new IntPtr(pIndices));
} }
} }
return Value.CreateValue(debugger, element); return Value.CreateValue(debugger, element);

Loading…
Cancel
Save