diff options
author | Lluis Sanchez <lluis@novell.com> | 2009-11-19 16:04:12 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2009-11-19 16:04:12 +0300 |
commit | 915153e481cf06ee530f3a6ced708402c89f1469 (patch) | |
tree | aae7f431b31390170a35dc0195fc39007b87d87d /extras/MonoDevelop.Debugger.Mdb | |
parent | 52935206e85756843a320bc4a059abf67e8b3fef (diff) |
* Mono.Debugging.Server.Mdb/BacktraceWrapper.cs: Subclass
BaseBacktrace and reuse some code from it.
* Mono.Debugging.Server.Mdb/MdbObjectValueAdaptor.cs: Track api
changes. Improved check for evaluation options.
svn path=/trunk/monodevelop/; revision=146531
Diffstat (limited to 'extras/MonoDevelop.Debugger.Mdb')
3 files changed, 24 insertions, 68 deletions
diff --git a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/BacktraceWrapper.cs b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/BacktraceWrapper.cs index a15508b1af..e440d39253 100644 --- a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/BacktraceWrapper.cs +++ b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/BacktraceWrapper.cs @@ -12,13 +12,13 @@ using Mono.Debugger.Languages; namespace DebuggerServer { - class BacktraceWrapper: RemoteFrameObject, IBacktrace, IDisposable + class BacktraceWrapper: BaseBacktrace, IBacktrace, IDisposable { MD.StackFrame[] frames; DissassemblyBuffer[] disBuffers; bool disposed; - public BacktraceWrapper (MD.StackFrame[] frames) + public BacktraceWrapper (MD.StackFrame[] frames): base (Server.Instance.MdbObjectValueAdaptor) { this.frames = frames; Connect (); @@ -29,11 +29,11 @@ namespace DebuggerServer disposed = true; } - public int FrameCount { + public override int FrameCount { get { return frames.Length; } } - public DL.StackFrame[] GetStackFrames (int firstIndex, int lastIndex) + public override DL.StackFrame[] GetStackFrames (int firstIndex, int lastIndex) { CheckDisposed (); @@ -72,14 +72,14 @@ namespace DebuggerServer return list.ToArray (); } - protected EvaluationContext GetEvaluationContext (int frameIndex, EvaluationOptions options) + protected override EvaluationContext GetEvaluationContext (int frameIndex, EvaluationOptions options) { CheckDisposed (); MD.StackFrame frame = frames [frameIndex]; return new MdbEvaluationContext (frame.Thread, frame, options); } - public AssemblyLine[] Disassemble (int frameIndex, int firstLine, int count) + public override AssemblyLine[] Disassemble (int frameIndex, int firstLine, int count) { CheckDisposed (); if (disBuffers == null) @@ -100,63 +100,6 @@ namespace DebuggerServer if (disposed) throw new InvalidOperationException ("Invalid stack frame"); } - - public ObjectValue[] GetAllLocals (int frameIndex, EvaluationOptions options) - { - List<ObjectValue> locals = new List<ObjectValue> (); - - locals.AddRange (GetLocalVariables (frameIndex, options)); - locals.AddRange (GetParameters (frameIndex, options)); - locals.Sort (delegate (ObjectValue v1, ObjectValue v2) { - return v1.Name.CompareTo (v2.Name); - }); - - ObjectValue thisObj = GetThisReference (frameIndex, options); - if (thisObj != null) - locals.Insert (0, thisObj); - - return locals.ToArray (); - } - - public ObjectValue[] GetExpressionValues (int frameIndex, string[] expressions, EvaluationOptions options) - { - EvaluationContext ctx = GetEvaluationContext (frameIndex, options); - return ctx.Adapter.GetExpressionValuesAsync (ctx, expressions); - } - - public ObjectValue[] GetLocalVariables (int frameIndex, EvaluationOptions options) - { - EvaluationContext ctx = GetEvaluationContext (frameIndex, options); - List<ObjectValue> list = new List<ObjectValue> (); - foreach (ValueReference var in ctx.Adapter.GetLocalVariables (ctx)) - list.Add (var.CreateObjectValue (true)); - return list.ToArray (); - } - - public ObjectValue[] GetParameters (int frameIndex, EvaluationOptions options) - { - EvaluationContext ctx = GetEvaluationContext (frameIndex, options); - List<ObjectValue> vars = new List<ObjectValue> (); - foreach (ValueReference var in ctx.Adapter.GetParameters (ctx)) - vars.Add (var.CreateObjectValue (true)); - return vars.ToArray (); - } - - public ObjectValue GetThisReference (int frameIndex, EvaluationOptions options) - { - EvaluationContext ctx = GetEvaluationContext (frameIndex, options); - ValueReference var = ctx.Adapter.GetThisReference (ctx); - if (var != null) - return var.CreateObjectValue (); - else - return null; - } - - public virtual CompletionData GetExpressionCompletionData (int frameIndex, string exp) - { - EvaluationContext ctx = GetEvaluationContext (frameIndex, EvaluationOptions.DefaultOptions); - return ctx.Adapter.GetExpressionCompletionData (ctx, exp); - } } class MdbDissassemblyBuffer: DissassemblyBuffer diff --git a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/ChangeLog b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/ChangeLog index 154979bc8d..d71ed17983 100644 --- a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/ChangeLog +++ b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/ChangeLog @@ -1,3 +1,11 @@ +2009-11-19 Lluis Sanchez Gual <lluis@novell.com> + + * BacktraceWrapper.cs: Subclass BaseBacktrace and reuse some + code from it. + + * MdbObjectValueAdaptor.cs: Track api changes. Improved check + for evaluation options. + 2009-11-18 Lluis Sanchez Gual <lluis@novell.com> * MdbObjectValueAdaptor.cs: Always show properties, even if we diff --git a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/MdbObjectValueAdaptor.cs b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/MdbObjectValueAdaptor.cs index 52c974a1d4..9b61f95234 100644 --- a/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/MdbObjectValueAdaptor.cs +++ b/extras/MonoDevelop.Debugger.Mdb/Mono.Debugging.Server.Mdb/MdbObjectValueAdaptor.cs @@ -106,7 +106,7 @@ namespace DebuggerServer if (ctx.Options.AllowTargetInvoke) { if (co.TypeName == "System.Decimal") return new LiteralExp (CallToString (ctx, co)); - if (tdata.ValueDisplayString != null) + if (tdata.ValueDisplayString != null && ctx.Options.AllowDisplayStringEvaluation) return new LiteralExp (EvaluateDisplayString (ctx, co, tdata.ValueDisplayString)); } @@ -194,7 +194,6 @@ namespace DebuggerServer TypeDisplayData data = new TypeDisplayData (); if (tt.ClassType.DebuggerTypeProxyAttribute != null) { data.ProxyType = tt.ClassType.DebuggerTypeProxyAttribute.ProxyTypeName; - data.IsProxyType = true; } if (tt.ClassType.DebuggerDisplayAttribute != null) { data.NameDisplayString = tt.ClassType.DebuggerDisplayAttribute.Name; @@ -219,6 +218,12 @@ namespace DebuggerServer return ctx.GetRealObject (val) is TargetFundamentalObject; } + public override bool IsEnum (EvaluationContext gctx, object val) + { + MdbEvaluationContext ctx = (MdbEvaluationContext) gctx; + return ctx.GetRealObject (val) is TargetEnumObject; + } + public override bool IsNull (EvaluationContext gctx, object val) { MdbEvaluationContext ctx = (MdbEvaluationContext) gctx; @@ -528,19 +533,19 @@ namespace DebuggerServer return ObjectValue.CreateUnknown (path.LastName); else { string tvalue; - if (!string.IsNullOrEmpty (tdata.ValueDisplayString)) + if (!string.IsNullOrEmpty (tdata.ValueDisplayString) && ctx.Options.AllowDisplayStringEvaluation) tvalue = EvaluateDisplayString (ctx, co, tdata.ValueDisplayString); else tvalue = ctx.Evaluator.TargetObjectToExpression (ctx, obj); string tname; - if (!string.IsNullOrEmpty (tdata.TypeDisplayString)) + if (!string.IsNullOrEmpty (tdata.TypeDisplayString) && ctx.Options.AllowDisplayStringEvaluation) tname = EvaluateDisplayString (ctx, co, tdata.TypeDisplayString); else tname = obj.TypeName; ObjectValue val = ObjectValue.CreateObject (source, path, tname, tvalue, flags, null); - if (!string.IsNullOrEmpty (tdata.NameDisplayString)) + if (!string.IsNullOrEmpty (tdata.NameDisplayString) && ctx.Options.AllowDisplayStringEvaluation) val.Name = EvaluateDisplayString (ctx, co, tdata.NameDisplayString); return val; } |