當前位置: 首頁>>代碼示例>>C#>>正文


C# Soft.ValueImpl類代碼示例

本文整理匯總了C#中Mono.Debugger.Soft.ValueImpl的典型用法代碼示例。如果您正苦於以下問題:C# ValueImpl類的具體用法?C# ValueImpl怎麽用?C# ValueImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ValueImpl類屬於Mono.Debugger.Soft命名空間,在下文中一共展示了ValueImpl類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Array_GetValues

 internal ValueImpl[] Array_GetValues(long id, int index, int len)
 {
     var r = SendReceive (CommandSet.ARRAY_REF, (int)CmdArrayRef.GET_VALUES, new PacketWriter ().WriteId (id).WriteInt (index).WriteInt (len));
     ValueImpl[] res = new ValueImpl [len];
     for (int i = 0; i < len; ++i)
         res [i] = r.ReadValue ();
     return res;
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:8,代碼來源:Connection.cs

示例2: WriteValue

            public PacketWriter WriteValue(ValueImpl v)
            {
                ElementType t;

                if (v.Value != null)
                    t = TypeCodeToElementType (Type.GetTypeCode (v.Value.GetType ()));
                else
                    t = v.Type;
                WriteByte ((byte)t);
                switch (t) {
                case ElementType.Boolean:
                    WriteInt ((bool)v.Value ? 1 : 0);
                    break;
                case ElementType.Char:
                    WriteInt ((int)(char)v.Value);
                    break;
                case ElementType.I1:
                    WriteInt ((int)(sbyte)v.Value);
                    break;
                case ElementType.U1:
                    WriteInt ((int)(byte)v.Value);
                    break;
                case ElementType.I2:
                    WriteInt ((int)(short)v.Value);
                    break;
                case ElementType.U2:
                    WriteInt ((int)(ushort)v.Value);
                    break;
                case ElementType.I4:
                    WriteInt ((int)(int)v.Value);
                    break;
                case ElementType.U4:
                    WriteInt ((int)(uint)v.Value);
                    break;
                case ElementType.I8:
                    WriteLong ((long)(long)v.Value);
                    break;
                case ElementType.U8:
                    WriteLong ((long)(ulong)v.Value);
                    break;
                case ElementType.R4:
                    WriteFloat ((float)v.Value);
                    break;
                case ElementType.R8:
                    WriteDouble ((double)v.Value);
                    break;
                case ElementType.String:
                case ElementType.SzArray:
                case ElementType.Class:
                case ElementType.Array:
                case ElementType.Object:
                    WriteId (v.Objid);
                    break;
                case ElementType.ValueType:
                    // FIXME:
                    if (v.IsEnum)
                        throw new NotImplementedException ();
                    WriteByte (0);
                    WriteId (v.Klass);
                    WriteInt (v.Fields.Length);
                    for (int i = 0; i < v.Fields.Length; ++i)
                        WriteValue (v.Fields [i]);
                    break;
                case (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL:
                    break;
                default:
                    throw new NotImplementedException ();
                }

                return this;
            }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:71,代碼來源:Connection.cs

示例3: WriteValues

 public PacketWriter WriteValues(ValueImpl[] values)
 {
     for (int i = 0; i < values.Length; ++i)
         WriteValue (values [i]);
     return this;
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:6,代碼來源:Connection.cs

示例4: read_invoke_res

 void read_invoke_res(PacketReader r, out ValueImpl v, out ValueImpl exc, out ValueImpl out_this, out ValueImpl[] out_args)
 {
     int resflags = r.ReadByte ();
     v = null;
     exc = null;
     out_this = null;
     out_args = null;
     if (resflags == 0) {
         exc = r.ReadValue ();
     } else {
         v = r.ReadValue ();
         if ((resflags & 2) != 0)
             out_this = r.ReadValue ();
         if ((resflags & 4) != 0) {
             int nargs = r.ReadInt ();
             out_args = new ValueImpl [nargs];
             for (int i = 0; i < nargs; ++i)
                 out_args [i] = r.ReadValue ();
         }
     }
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:21,代碼來源:Connection.cs

示例5: ReadValue

            public ValueImpl ReadValue()
            {
                ElementType etype = (ElementType)ReadByte ();

                switch (etype) {
                case ElementType.Void:
                    return new ValueImpl { Type = etype };
                case ElementType.I1:
                    return new ValueImpl { Type = etype, Value = (sbyte)ReadInt () };
                case ElementType.U1:
                    return new ValueImpl { Type = etype, Value = (byte)ReadInt () };
                case ElementType.Boolean:
                    return new ValueImpl { Type = etype, Value = ReadInt () != 0 };
                case ElementType.I2:
                    return new ValueImpl { Type = etype, Value = (short)ReadInt () };
                case ElementType.U2:
                    return new ValueImpl { Type = etype, Value = (ushort)ReadInt () };
                case ElementType.Char:
                    return new ValueImpl { Type = etype, Value = (char)ReadInt () };
                case ElementType.I4:
                    return new ValueImpl { Type = etype, Value = ReadInt () };
                case ElementType.U4:
                    return new ValueImpl { Type = etype, Value = (uint)ReadInt () };
                case ElementType.I8:
                    return new ValueImpl { Type = etype, Value = ReadLong () };
                case ElementType.U8:
                    return new ValueImpl { Type = etype, Value = (ulong)ReadLong () };
                case ElementType.R4:
                    return new ValueImpl { Type = etype, Value = ReadFloat () };
                case ElementType.R8:
                    return new ValueImpl { Type = etype, Value = ReadDouble () };
                case ElementType.I:
                case ElementType.U:
                case ElementType.Ptr:
                    // FIXME: The client and the debuggee might have different word sizes
                    return new ValueImpl { Type = etype, Value = ReadLong () };
                case ElementType.String:
                case ElementType.SzArray:
                case ElementType.Class:
                case ElementType.Array:
                case ElementType.Object:
                    long objid = ReadId ();
                    return new ValueImpl () { Type = etype, Objid = objid };
                case ElementType.ValueType:
                    bool is_enum = ReadByte () == 1;
                    long klass = ReadId ();
                    long nfields = ReadInt ();
                    ValueImpl[] fields = new ValueImpl [nfields];
                    for (int i = 0; i < nfields; ++i)
                        fields [i] = ReadValue ();
                    return new ValueImpl () { Type = etype, Klass = klass, Fields = fields, IsEnum = is_enum };
                case (ElementType)ValueTypeId.VALUE_TYPE_ID_NULL:
                    return new ValueImpl { Type = etype };
                case (ElementType)ValueTypeId.VALUE_TYPE_ID_TYPE:
                    return new ValueImpl () { Type = etype, Id = ReadId () };
                case (ElementType)ValueTypeId.VALUE_TYPE_ID_PARENT_VTYPE:
                    return new ValueImpl () { Type = etype, Index = ReadInt () };
                default:
                    throw new NotImplementedException ("Unable to handle type " + etype);
                }
            }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:61,代碼來源:Connection.cs

示例6: InvokeCB

		// This is called when the result of an invoke is received
		static void InvokeCB (ValueImpl v, ValueImpl exc, ValueImpl out_this, ValueImpl[] out_args, ErrorCode error, object state) {
			InvokeAsyncResult r = (InvokeAsyncResult)state;

			if (error != 0) {
				r.ErrorCode = error;
			} else {
				r.Value = v;
				r.Exception = exc;
			}

			r.OutThis = out_this;
			r.OutArgs = out_args;

			r.IsCompleted = true;
			((ManualResetEvent)r.AsyncWaitHandle).Set ();

			if (r.Callback != null)
				r.Callback.BeginInvoke (r, null, null);
		}
開發者ID:xzkmxd,項目名稱:mono,代碼行數:20,代碼來源:ObjectMirror.cs

示例7: VM_BeginInvokeMethod

		internal int VM_BeginInvokeMethod (long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, InvokeMethodCallback callback, object state) {
			return Send (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments), delegate (PacketReader r) {
					ValueImpl v, exc;

					if (r.ErrorCode != 0) {
						callback (null, null, (ErrorCode)r.ErrorCode, state);
					} else {
						if (r.ReadByte () == 0) {
							exc = r.ReadValue ();
							v = null;
						} else {
							v = r.ReadValue ();
							exc = null;
						}

						callback (v, exc, 0, state);
					}
				}, 1);
		}
開發者ID:alaendle,項目名稱:mono,代碼行數:19,代碼來源:Connection.cs

示例8: Type_SetValues

 internal void Type_SetValues(long id, long[] fields, ValueImpl[] values)
 {
     SendReceive (CommandSet.TYPE, (int)CmdType.SET_VALUES, new PacketWriter ().WriteId (id).WriteInt (fields.Length).WriteIds (fields).WriteValues (values));
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:4,代碼來源:Connection.cs

示例9: VM_BeginInvokeMethod

        internal int VM_BeginInvokeMethod(long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, InvokeMethodCallback callback, object state)
        {
            return Send (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments), delegate (PacketReader r) {
                    ValueImpl v, exc, out_this = null;
                    ValueImpl[] out_args = null;

                    if (r.ErrorCode != 0) {
                        callback (null, null, null, null, (ErrorCode)r.ErrorCode, state);
                    } else {
                        read_invoke_res (r, out v, out exc, out out_this, out out_args);
                        callback (v, exc, out_this, out_args, 0, state);
                    }
                }, 1);
        }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:14,代碼來源:Connection.cs

示例10: StackFrame_SetValues

 internal void StackFrame_SetValues(long thread_id, long id, int[] pos, ValueImpl[] values)
 {
     /* pos < 0 -> argument at pos (-pos) - 1 */
     /* pos >= 0 -> local at pos */
     int len = pos.Length;
     SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values));
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:7,代碼來源:Connection.cs

示例11: Type_GetValues

        internal ValueImpl[] Type_GetValues(long id, long[] fields, long thread_id)
        {
            int len = fields.Length;
            PacketReader r;
            if (thread_id != 0)
                r = SendReceive (CommandSet.TYPE, (int)CmdType.GET_VALUES_2, new PacketWriter ().WriteId (id).WriteId (thread_id).WriteInt (len).WriteIds (fields));
            else
                r = SendReceive (CommandSet.TYPE, (int)CmdType.GET_VALUES, new PacketWriter ().WriteId (id).WriteInt (len).WriteIds (fields));

            ValueImpl[] res = new ValueImpl [len];
            for (int i = 0; i < len; ++i)
                res [i] = r.ReadValue ();
            return res;
        }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:14,代碼來源:Connection.cs

示例12: StackFrame_GetValues

        internal ValueImpl[] StackFrame_GetValues(long thread_id, long id, int[] pos)
        {
            /* pos < 0 -> argument at pos (-pos) - 1 */
            /* pos >= 0 -> local at pos */
            int len = pos.Length;
            PacketReader r = SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos));

            ValueImpl[] res = new ValueImpl [len];
            for (int i = 0; i < len; ++i)
                res [i] = r.ReadValue ();
            return res;
        }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:12,代碼來源:Connection.cs

示例13: Object_SetValues

 internal void Object_SetValues(long id, long[] fields, ValueImpl[] values)
 {
     SendReceive (CommandSet.OBJECT_REF, (int)CmdObjectRef.SET_VALUES, new PacketWriter ().WriteId (id).WriteInt (fields.Length).WriteIds (fields).WriteValues (values));
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:4,代碼來源:Connection.cs

示例14: Object_GetValues

        internal ValueImpl[] Object_GetValues(long id, long[] fields)
        {
            int len = fields.Length;
            PacketReader r = SendReceive (CommandSet.OBJECT_REF, (int)CmdObjectRef.GET_VALUES, new PacketWriter ().WriteId (id).WriteInt (len).WriteIds (fields));

            ValueImpl[] res = new ValueImpl [len];
            for (int i = 0; i < len; ++i)
                res [i] = r.ReadValue ();
            return res;
        }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:10,代碼來源:Connection.cs

示例15: Array_SetValues

 internal void Array_SetValues(long id, int index, ValueImpl[] values)
 {
     SendReceive (CommandSet.ARRAY_REF, (int)CmdArrayRef.SET_VALUES, new PacketWriter ().WriteId (id).WriteInt (index).WriteInt (values.Length).WriteValues (values));
 }
開發者ID:nerzhulart,項目名稱:debugger-libs,代碼行數:4,代碼來源:Connection.cs


注:本文中的Mono.Debugger.Soft.ValueImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。