protected void EnsureContextHasDomain (AppDomainMirror domain)
		{
			var softEvaluationContext = (SoftEvaluationContext)Context;
			if (softEvaluationContext.Domain == domain)
				return;

			var clone = (SoftEvaluationContext)softEvaluationContext.Clone ();
			clone.Domain = domain;
			Context = clone;
		}
		public SoftEvaluationContext (SoftDebuggerSession session, StackFrame frame, DC.EvaluationOptions options): base (options)
		{
			Frame = frame;
			Thread = frame.Thread;
			Domain = Thread.Domain;

			string method = frame.Method.Name;
			if (frame.Method.DeclaringType != null)
				method = frame.Method.DeclaringType.FullName + "." + method;
			var location = new DC.SourceLocation (method, frame.FileName, frame.LineNumber, frame.ColumnNumber);
			string language;

			if (frame.Method != null) {
				language = frame.IsNativeTransition ? "Transition" : "Managed";
			} else {
				language = "Native";
			}
			
			Evaluator = session.GetEvaluator (new DC.StackFrame (frame.ILOffset, location, language, session.IsExternalCode (frame), true));
			Adapter = session.Adaptor;
			this.session = session;
			stackVersion = session.StackVersion;
			sourceAvailable = !string.IsNullOrEmpty (frame.FileName) && System.IO.File.Exists (frame.FileName);
		}
Пример #3
0
		void GetInfo () {
			var info = vm.conn.Object_GetInfo (id);
			type = vm.GetType (info.type_id);
			domain = vm.GetDomain (info.domain_id);
		}
Пример #4
0
		internal ObjectMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id) {
			this.type = type;
			this.domain = domain;
		}
Пример #5
0
		internal ThreadMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id, type, domain) {
		}
 internal ObjectMirror(VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base(vm, id)
 {
     this.type   = type;
     this.domain = domain;
 }
Пример #7
0
        internal T GetObject <T> (long id, long domain_id, long type_id) where T : ObjectMirror
        {
            ObjectMirror obj = null;

            lock (objects_lock) {
                if (objects == null)
                {
                    objects = new Dictionary <long, ObjectMirror> ();
                }
                objects.TryGetValue(id, out obj);
            }

            if (obj == null)
            {
                /*
                 * Obtain the domain/type of the object to determine the type of
                 * object we need to create. Do this outside the lock.
                 */
                if (domain_id == 0 || type_id == 0)
                {
                    if (conn.Version.AtLeast(2, 5))
                    {
                        var info = conn.Object_GetInfo(id);
                        domain_id = info.domain_id;
                        type_id   = info.type_id;
                    }
                    else
                    {
                        if (domain_id == 0)
                        {
                            domain_id = conn.Object_GetDomain(id);
                        }
                        if (type_id == 0)
                        {
                            type_id = conn.Object_GetType(id);
                        }
                    }
                }
                AppDomainMirror d = GetDomain(domain_id);
                TypeMirror      t = GetType(type_id);

                if (t.Assembly == d.Corlib && t.Namespace == "System.Threading" && t.Name == "Thread")
                {
                    obj = new ThreadMirror(this, id, t, d);
                }
                else if (t.Assembly == d.Corlib && t.Namespace == "System" && t.Name == "String")
                {
                    obj = new StringMirror(this, id, t, d);
                }
                else if (typeof(T) == typeof(ArrayMirror))
                {
                    obj = new ArrayMirror(this, id, t, d);
                }
                else
                {
                    obj = new ObjectMirror(this, id, t, d);
                }

                // Publish
                lock (objects_lock) {
                    ObjectMirror prev_obj;
                    if (objects.TryGetValue(id, out prev_obj))
                    {
                        obj = prev_obj;
                    }
                    else
                    {
                        objects [id] = obj;
                    }
                }
            }
            return((T)obj);
        }
 internal ArrayMirror(VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base(vm, id, type, domain)
 {
 }
Пример #9
0
 internal StringMirror(VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base(vm, id, type, domain)
 {
     length = -1;
 }
Пример #10
0
 private void DoShowInfo(AppDomainMirror domain, System.Text.StringBuilder builder)
 {
     builder.AppendLine(string.Format("Domain: {0}", domain.FriendlyName));
 }
Пример #11
0
		internal StringMirror (VirtualMachine vm, long id, TypeMirror type, AppDomainMirror domain) : base (vm, id, type, domain) {
			length = -1;
		}