diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-02-02 10:16:55 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-02-02 10:16:55 +0400 |
commit | 7325b48908fa43038dc61003ea841658122db8d2 (patch) | |
tree | 3991115cdddf9d32ec27d508c132b74b9701e802 /extras | |
parent | 567d55cbce6ac0dbbf83d0070e755322c1fc95a3 (diff) | |
parent | 561a3548cfc05183e636caf2578263d4a36a70b5 (diff) |
Merge branch 'master' into newresolver
Conflicts:
main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Makefile.am
version-checks
Diffstat (limited to 'extras')
4 files changed, 90 insertions, 11 deletions
diff --git a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs index d05fbde242..095fc8a27b 100644 --- a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs +++ b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ArrayAdaptor.cs @@ -34,18 +34,19 @@ namespace MonoDevelop.Debugger.Win32 { class ArrayAdaptor: ICollectionAdaptor { - CorValRef obj; CorEvaluationContext ctx; + CorArrayValue array; + CorValRef obj; - public ArrayAdaptor (EvaluationContext ctx, CorValRef obj) + public ArrayAdaptor (EvaluationContext ctx, CorValRef obj, CorArrayValue array) { - this.obj = obj; this.ctx = (CorEvaluationContext) ctx; + this.array = array; + this.obj = obj; } public int[] GetDimensions () { - CorArrayValue array = CorObjectAdaptor.GetRealObject (ctx, obj) as CorArrayValue; if (array != null) return array.GetDimensions (); else @@ -55,7 +56,6 @@ namespace MonoDevelop.Debugger.Win32 public object GetElement (int[] indices) { return new CorValRef (delegate { - CorArrayValue array = CorObjectAdaptor.GetRealObject (ctx, obj) as CorArrayValue; if (array != null) return array.GetElement (indices); else @@ -77,7 +77,6 @@ namespace MonoDevelop.Debugger.Win32 public ObjectValue CreateElementValue (ArrayElementGroup grp, ObjectPath path, int[] indices) { - CorArrayValue array = CorObjectAdaptor.GetRealObject (ctx, obj) as CorArrayValue; if (array != null) { CorValRef elem = (CorValRef) GetElement (indices); return ctx.Adapter.CreateObjectValue (ctx, grp, path, elem, ObjectValueFlags.ArrayElement); diff --git a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs index 701f231ac2..808028c0d7 100644 --- a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs +++ b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs @@ -63,6 +63,11 @@ namespace MonoDevelop.Debugger.Win32 {
return GetRealObject (ctx, val) is CorArrayValue;
}
+
+ public override bool IsString (EvaluationContext ctx, object val)
+ {
+ return GetRealObject (ctx, val) is CorStringValue;
+ }
public override bool IsClassInstance (EvaluationContext ctx, object val)
{
@@ -281,7 +286,9 @@ namespace MonoDevelop.Debugger.Win32 CorValRef arr = new CorValRef (delegate {
return ctx.Session.NewArray (ctx, (CorType)GetValueType (ctx, val), 1);
});
- ArrayAdaptor realArr = new ArrayAdaptor (ctx, arr);
+ CorArrayValue array = CorObjectAdaptor.GetRealObject (ctx, arr) as CorArrayValue;
+
+ ArrayAdaptor realArr = new ArrayAdaptor (ctx, arr, array);
realArr.SetElement (new int[] { 0 }, val);
CorType at = (CorType) GetType (ctx, "System.Array");
@@ -646,8 +653,20 @@ namespace MonoDevelop.Debugger.Win32 public override ICollectionAdaptor CreateArrayAdaptor (EvaluationContext ctx, object arr)
{
- if (GetRealObject (ctx, arr) is CorArrayValue)
- return new ArrayAdaptor (ctx, (CorValRef) arr);
+ CorValue val = CorObjectAdaptor.GetRealObject (ctx, arr);
+
+ if (val is CorArrayValue)
+ return new ArrayAdaptor (ctx, (CorValRef) arr, (CorArrayValue) val);
+ else
+ return null;
+ }
+
+ public override IStringAdaptor CreateStringAdaptor (EvaluationContext ctx, object str)
+ {
+ CorValue val = CorObjectAdaptor.GetRealObject (ctx, str);
+
+ if (val is CorStringValue)
+ return new StringAdaptor (ctx, (CorValRef) str, (CorStringValue) val);
else
return null;
}
diff --git a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj index a13addf603..09baf053a2 100644 --- a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj +++ b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -97,6 +97,7 @@ </ItemGroup> <ItemGroup> <Compile Include="ArrayAdaptor.cs" /> + <Compile Include="StringAdaptor.cs" /> <Compile Include="CorBacktrace.cs" /> <Compile Include="CorMethodCall.cs" /> <Compile Include="CorValRef.cs" /> @@ -148,4 +149,4 @@ <Target Name="AfterBuild"> </Target> --> -</Project>
\ No newline at end of file +</Project> diff --git a/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/StringAdaptor.cs b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/StringAdaptor.cs new file mode 100644 index 0000000000..022156ea3e --- /dev/null +++ b/extras/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/StringAdaptor.cs @@ -0,0 +1,60 @@ +// +// StringAdaptor.cs +// +// Author: Jeffrey Stedfast <jeff@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +using System; +using Mono.Debugging.Client; +using Microsoft.Samples.Debugging.CorDebug; +using Mono.Debugging.Evaluation; + +namespace MonoDevelop.Debugger.Win32 +{ + public class StringAdaptor: IStringAdaptor + { + CorEvaluationContext ctx; + CorStringValue str; + CorValRef obj; + + public StringAdaptor (EvaluationContext ctx, CorValRef obj, CorStringValue str) + { + this.ctx = (CorEvaluationContext) ctx; + this.str = str; + this.obj = obj; + } + + public int Length { + get { return str.Length; } + } + + public string Value { + get { return str.String; } + } + + public string Substring (int index, int length) + { + return str.String.Substring (index, length); + } + } +} |