diff options
author | David Karlaš <david.karlas@xamarin.com> | 2015-05-05 15:03:55 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2015-05-05 15:50:16 +0300 |
commit | 5c72b004d1cefd1bacb754a0ffced55b43901aec (patch) | |
tree | c5e5cd9c91d34c18f291a1e50e556c8d734e105c /main/src/addins/MonoDevelop.Debugger.Win32 | |
parent | 81e272ce16164cecae5bb064e8a7428547f4faac (diff) |
[CorDebugger] Fixed "Bug 26237 - Debugger ignores non-zero based arrays" for CorDebugger and added unit test
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.Win32')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/debug/Value.cs | 10 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/debug/Value.cs b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/debug/Value.cs index 184c6b6f32..4e288b0027 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/debug/Value.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/debug/Value.cs @@ -745,6 +745,16 @@ namespace Microsoft.Samples.Debugging.CorDebug return sdims;
}
+ public int[] GetBaseIndicies()
+ {
+ Debug.Assert(Rank!=0);
+ uint[] baseIndicies = new uint[Rank];
+ m_arrayVal.GetBaseIndicies((uint)baseIndicies.Length,baseIndicies);
+
+ int[] sdims = Array.ConvertAll<uint,int>( baseIndicies, delegate(uint u) { return (int)u; } );
+ return sdims;
+ }
+
public CorValue GetElement(int[] indices)
{
Debug.Assert(indices!=null);
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs index 52bec05b19..1c25fde654 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs @@ -47,7 +47,11 @@ namespace MonoDevelop.Debugger.Win32 public int[] GetLowerBounds () { - return new int[array != null ? array.Rank : 0]; + if (array != null && array.HasBaseIndicies) { + return array.GetBaseIndicies (); + } else { + return new int[GetDimensions ().Length]; + } } public int[] GetDimensions () |