当前位置: 首页>>代码示例>>C#>>正文


C# Soft.ThreadMirror类代码示例

本文整理汇总了C#中Mono.Debugger.Soft.ThreadMirror的典型用法代码示例。如果您正苦于以下问题:C# ThreadMirror类的具体用法?C# ThreadMirror怎么用?C# ThreadMirror使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ThreadMirror类属于Mono.Debugger.Soft命名空间,在下文中一共展示了ThreadMirror类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AD7Thread

 public AD7Thread(AD7Engine engine, DebuggedThread debuggedThread)//ThreadMirror threadMirror)
 {
     _engine = engine;
     
     ThreadMirror = debuggedThread.Thread;
     _debuggedThread = debuggedThread;
 }
开发者ID:aluitink,项目名称:aspnet-debug2,代码行数:7,代码来源:AD7Thread.cs

示例2: VariableItem

        // name is a field name, local variable name, etc.
        // parent is a LiveStackFrame, ObjectMirror, ArrayMirror, etc. Parents are always non-null except for the LiveStackFrame parent.
        // key is an integral index, a FieldInfoMirror, LocalVariable, etc.
        // value is the object associated with the parent/key. It will be a Value or a primitive type (like char or int).
        public VariableItem(ThreadMirror thread, string name, VariableItem parent, object key, object value, int index)
            : base(NSObject.AllocAndInitInstance("VariableItem"))
        {
            Contract.Requires(thread != null);
            Contract.Requires(!string.IsNullOrEmpty(name));
            Contract.Requires(parent != null || value is LiveStackFrame);
            Contract.Requires(key != null || value is LiveStackFrame);
            Contract.Requires(value != null);					// null debugger values are PrimitiveValues with a null Value
            Contract.Requires(index >= 0);

            Parent = parent;
            Key = key;
            Value = value;
            m_index = index;
            m_actualName = name;
            m_actualValue = value;

            Details details = DoGetDetails(thread, name, parent, key, value);

            Value = details.Value;
            AttributedName = NSMutableAttributedString.Create(details.DisplayName).Retain();
            AttributedType = NSAttributedString.Create(details.DisplayType).Retain();
            AttributedValue = NSAttributedString.Create(details.DisplayValue).Retain();
            NumberOfChildren = details.NumberOfChildren;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:29,代码来源:VariableItem.cs

示例3: DoGetRefCount

        private string DoGetRefCount(ThreadMirror thread)
        {
            string result = null;

            // Using InvokeMethod causes the VM to exit. Not sure what calling InvokeMethod
            // does, but if it is working it takes forever to finish.
            #if DOES_NOT_WORK
            ObjectMirror value = Object as ObjectMirror;
            if (value != null && value.Type.IsType("MObjc.NSObject"))
            {
                MethodMirror method = value.Type.FindMethod("retainCount", 0);
                if (method != null)
                {
                    Value v = value.InvokeMethod(thread, method, new Value[0], InvokeOptions.DisableBreakpoints | InvokeOptions.SingleThreaded);
            //					var invoker = new InvokeMethod();
            //					Value v = invoker.Invoke(thread, value, "retainCount");
                    PrimitiveValue p = v as PrimitiveValue;
                    if (p != null)
                        result = string.Format(" (retainCount = {0})", p.Value);
                }
            }
            #endif

            return result;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:25,代码来源:TraceRoots.cs

示例4: StepEventRequest

		internal StepEventRequest (VirtualMachine vm, ThreadMirror thread) : base (vm, EventType.Step) {
			if (thread == null)
				throw new ArgumentNullException ("thread");
			CheckMirror (vm, thread);
			this.step_thread = thread;
			Depth = StepDepth.Into;
			Size = StepSize.Min;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:StepEventRequest.cs

示例5: StackFrame

 /*
  * FIXME: Decide on the way to request/handle debugging information:
  * - request the info in bulk for all frames/on demand for individual frames
  * - request the info from the runtime/request only the il offset, and compute
  *   everything else based on this info using the method debug info.
  */
 internal StackFrame(VirtualMachine vm, long id, ThreadMirror thread, MethodMirror method, int il_offset, StackFrameFlags flags)
     : base(vm, id)
 {
     this.thread = thread;
     this.method = method;
     this.il_offset = il_offset;
     this.flags = flags;
 }
开发者ID:peterdocter,项目名称:debugger-libs,代码行数:14,代码来源:StackFrame.cs

示例6: DebuggedThread

 public DebuggedThread(ThreadMirror thread, AD7Engine engine)
 {
     Thread = thread;
     Id = thread.TID;
     Name = "";
     TargetId = thread.TID;
     AD7Thread ad7Thread = new AD7Thread(engine, this);
     Client = ad7Thread;
 }
开发者ID:aluitink,项目名称:aspnet-debug2,代码行数:9,代码来源:DebuggedThread.cs

示例7: SoftDebuggerBacktrace

		public SoftDebuggerBacktrace (SoftDebuggerSession session, MDB.ThreadMirror thread): base (session.Adaptor)
		{
			this.session = session;
			this.thread = thread;
			stackVersion = session.StackVersion;
			if (thread != null)
				this.frames = thread.GetFrames ();
			else
				this.frames = new MDB.StackFrame[0];
		}
开发者ID:kmarecki,项目名称:monodevelop,代码行数:10,代码来源:SoftDebuggerBacktrace.cs

示例8: Set

 public static void Set(ThreadMirror thread, VariableItem item, InstanceValue parent, FieldInfoMirror key, Value newValue)
 {
     if (key.IsStatic)
     {
         key.DeclaringType.SetValue(key, newValue);
     }
     else
     {
         var o = (ObjectMirror) parent.Instance;
         o.SetValue(key, newValue);
     }
 }
开发者ID:andyhebear,项目名称:Continuum,代码行数:12,代码来源:SetValueOverloads.cs

示例9: Write

        public void Write(System.IO.StreamWriter stream, ThreadMirror thread, int indent)
        {
            for (int i = 0; i < indent; ++i)
            {
                stream.Write('\t');
            }

            string refCount = DoGetRefCount(thread);
            stream.WriteLine("{0}{1}\t\t\t\t{2}", Name, refCount, Type);

            foreach (Trace child in Children)
            {
                child.Write(stream, thread, indent + 1);
            }
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:15,代码来源:TraceRoots.cs

示例10: UnsafeInvoke

        // Like the above except exceptions are allowed to escape.
        public Value UnsafeInvoke(ThreadMirror thread, Value target, string name)
        {
            Contract.Requires(thread != null, "thread is null");
            Contract.Requires(target != null, "target is null");
            Contract.Requires(target is ObjectMirror || target is StructMirror, "target is a " + target.GetType().FullName);
            Contract.Requires(!name.IsNullOrWhiteSpace());

            Value result;
            if (target is ObjectMirror)
                result = DoInvoke(thread, (ObjectMirror) target, name);
            else
                result = DoInvoke(thread, (StructMirror) target, name);

            return result;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:16,代码来源:InvokeMethod.cs

示例11: GetThreadName

        public static string GetThreadName(ThreadMirror thread)
        {
            string name = thread.Name;

            if (thread.Id == 1)				// TODO: should we be using ThreadId here?
                name =  "main";
            else if (thread.Id == 2)
                name =  "finalizer";

            if (!string.IsNullOrEmpty(name))
                name = string.Format("{0} ({1})", name, thread.Id);
            else
                name = thread.Id.ToString();

            return name;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:16,代码来源:ThreadsController.cs

示例12: GetChild

        public static VariableItem GetChild(ThreadMirror thread, VariableItem parentItem, LiveStackFrame parent, int index)
        {
            VariableItem child;

            IList<LocalVariable> locals = parent.GetVisibleVariables();
            if (index < locals.Count)
            {
                LocalVariable local = locals[index];

                string name = local.Name;
                if (string.IsNullOrEmpty(name))
                    name = "$" + local.Index;			// temporary variable

                Value v = parent.GetValue(local);
                child = new VariableItem(thread, name, parentItem, local, v, index);
            }
            else
            {
                FieldInfoMirror[] fields = parent.Method.DeclaringType.GetAllFields().ToArray();
                Contract.Assert(fields.Length > 0);

                object v = null;
                string name = "this";
                if (parent.ThisPtr is ObjectMirror)
                {
                    v = new InstanceValue((ObjectMirror) parent.ThisPtr, fields);
                }
                else if (parent.ThisPtr is StructMirror)
                {
                    v = new InstanceValue((StructMirror) parent.ThisPtr, fields);
                }
                else if (parent.ThisPtr == null || parent.ThisPtr.IsNull())
                {
                    v = new TypeValue(parent.Method.DeclaringType);
                    name = "statics";
                }
                else
                {
                    Contract.Assert(false, parent.ThisPtr.TypeName() + " is bogus");
                }

                child = new VariableItem(thread, name, parentItem, index, v, index);
            }

            return child;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:46,代码来源:GetChildOverloads.cs

示例13: Evaluate

        // Target should be a ObjectMirror or a StructMirror. Name should be the name of a
        // property (e.g. Count), field (eg Empty), or nullary method. Returns an error string.
        public static Value Evaluate(ThreadMirror thread, Value target, string name)
        {
            Contract.Requires(thread != null, "thread is null");
            Contract.Requires(target != null, "target is null");
            Contract.Requires(!string.IsNullOrEmpty(name), "name is null or empty");

            Value result = null;

            // Try fields,
            if (target is ObjectMirror)
                result = DoGetField((ObjectMirror) target, name, thread);

            else if (target is StructMirror)
                result = DoGetField((StructMirror) target, name, thread);

            // properties.
            if (result == null)
            {
                if (target is ObjectMirror)
                    result = DoEvaluateProperty(thread, (ObjectMirror) target, name);

                else if (target is StructMirror)
                    result = DoEvaluateProperty(thread, (StructMirror) target, name);
            }

            // and methods.
            if (result == null)
            {
                if (target is ObjectMirror)
                    result = DoEvaluateMethod(thread, (ObjectMirror) target, name);

                else if (target is StructMirror)
                    result = DoEvaluateMethod(thread, (StructMirror) target, name);

                else
                    Contract.Assert(false, "Expected an ObjectMirror or StructMirror but got a " + target.GetType().FullName);
            }

            if (result == null)
                result = target.VirtualMachine.RootDomain.CreateString(string.Empty);	// usually ShouldEvaluate was false

            return result;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:45,代码来源:EvalMember.cs

示例14: set

        private const int Timeout = 500; // TODO: might want to allow this to be set (especially when we get an immediate window)

        #endregion Fields

        #region Methods

        // Invokes a nullary method on an ObjectMirror or StructMirror. If the call
        // times out a StringMirror is returned with an error message.
        public Value Invoke(ThreadMirror thread, Value target, string name)
        {
            Contract.Requires(thread != null, "thread is null");
            Contract.Requires(target != null, "target is null");
            Contract.Requires(target is ObjectMirror || target is StructMirror, "target is a " + target.GetType().FullName);
            Contract.Requires(!name.IsNullOrWhiteSpace());

            Value result;

            try
            {
                result = UnsafeInvoke(thread, target, name);
            }
            catch (Exception e)
            {
                result = thread.Domain.CreateString(e.Message);
            }

            return result;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:28,代码来源:InvokeMethod.cs

示例15: BeginInvokeMultiple

		//
		// Implementation of InvokeMultiple
		//

		internal static IInvokeAsyncResult BeginInvokeMultiple (VirtualMachine vm, ThreadMirror thread, MethodMirror[] methods, Value this_obj, IList<IList<Value>> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			if (thread == null)
				throw new ArgumentNullException ("thread");
			if (methods == null)
				throw new ArgumentNullException ("methods");
			foreach (var m in methods)
				if (m == null)
					throw new ArgumentNullException ("method");
			if (arguments == null) {
				arguments = new List<IList<Value>> ();
				for (int i = 0; i < methods.Length; ++i)
					arguments.Add (new Value [0]);
			} else {
				// FIXME: Not needed for property evaluation
				throw new NotImplementedException ();
			}
			if (callback == null)
				throw new ArgumentException ("A callback argument is required for this method.", "callback");

			InvokeFlags f = InvokeFlags.NONE;

			if ((options & InvokeOptions.DisableBreakpoints) != 0)
				f |= InvokeFlags.DISABLE_BREAKPOINTS;
			if ((options & InvokeOptions.SingleThreaded) != 0)
				f |= InvokeFlags.SINGLE_THREADED;

			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback, NumPending = methods.Length, IsMultiple = true };

			var mids = new long [methods.Length];
			for (int i = 0; i < methods.Length; ++i)
				mids [i] = methods [i].Id;
			var args = new List<ValueImpl[]> ();
			for (int i = 0; i < methods.Length; ++i)
				args.Add (vm.EncodeValues (arguments [i]));
			thread.InvalidateFrames ();
			r.ID = vm.conn.VM_BeginInvokeMethods (thread.Id, mids, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), args, f, InvokeMultipleCB, r);

			return r;
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:43,代码来源:ObjectMirror.cs


注:本文中的Mono.Debugger.Soft.ThreadMirror类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。