• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Soft.ValueImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: VM_BeginInvokeMethods

        internal int VM_BeginInvokeMethods(long thread, long[] methods, ValueImpl this_arg, List<ValueImpl[]> arguments, InvokeFlags flags, InvokeMethodCallback callback, object state)
        {
            // FIXME: Merge this with INVOKE_METHOD
            var w = new PacketWriter ();
            w.WriteId (thread);
            w.WriteInt ((int)flags);
            w.WriteInt (methods.Length);
            for (int i = 0; i < methods.Length; ++i) {
                w.WriteId (methods [i]);
                w.WriteValue (this_arg);
                w.WriteInt (arguments [i].Length);
                w.WriteValues (arguments [i]);
            }
            return Send (CommandSet.VM, (int)CmdVM.INVOKE_METHODS, w, 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);
                    }
                }, methods.Length);
        }
开发者ID:nerzhulart,项目名称:debugger-libs,代码行数:25,代码来源:Connection.cs


示例17: Domain_CreateBoxedValue

 internal long Domain_CreateBoxedValue(long id, long type_id, ValueImpl v)
 {
     return SendReceive (CommandSet.APPDOMAIN, (int)CmdAppDomain.CREATE_BOXED_VALUE, new PacketWriter ().WriteId (id).WriteId (type_id).WriteValue (v)).ReadId ();
 }
开发者ID:nerzhulart,项目名称:debugger-libs,代码行数:4,代码来源:Connection.cs


示例18: VM_InvokeMethod

 internal ValueImpl VM_InvokeMethod(long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, out ValueImpl exc)
 {
     exc = null;
     PacketReader r = SendReceive (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments));
     if (r.ReadByte () == 0) {
         exc = r.ReadValue ();
         return null;
     } else {
         return r.ReadValue ();
     }
 }
开发者ID:nerzhulart,项目名称:debugger-libs,代码行数:11,代码来源:Connection.cs


示例19: InvokeMultipleCB

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

			Interlocked.Decrement (ref r.NumPending);

			if (r.NumPending == 0) {
				r.IsCompleted = true;
				((ManualResetEvent)r.AsyncWaitHandle).Set ();
			}

			// Have to pass another asyncresult to the callback since multiple threads can execute it concurrently with results of multiple invocations
			var r2 = new InvokeAsyncResult { AsyncState = r.AsyncState, AsyncWaitHandle = null, VM = r.VM, Thread = r.Thread, Callback = r.Callback, IsCompleted = true };

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

			r.Callback.BeginInvoke (r2, null, null);
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:23,代码来源:ObjectMirror.cs


示例20: StackFrame_SetThis

		internal void StackFrame_SetThis (long thread_id, long id, ValueImpl value) {
			SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_THIS, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteValue (value));
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:3,代码来源:Connection.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Client.BreakEvent类代码示例发布时间:2022-05-26
下一篇:
C# Soft.Value类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap