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


C# BinaryReader.ReadULeb128方法代码示例

本文整理汇总了C#中System.IO.BinaryReader.ReadULeb128方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadULeb128方法的具体用法?C# BinaryReader.ReadULeb128怎么用?C# BinaryReader.ReadULeb128使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryReader的用法示例。


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

示例1: Backtrace

		public Backtrace (BinaryReader reader)
		{
			Flags = reader.ReadULeb128 ();
			ulong num = reader.ReadULeb128 ();
			Frame = new long[num];
			for (ulong i = 0; i < num; i++) {
				Frame [i] = reader.ReadSLeb128 ();
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:9,代码来源:Event.cs

示例2: AllocEvent

        public readonly ulong Size; // size of the object in the heap

        #endregion Fields

        #region Constructors

        AllocEvent(BinaryReader reader, byte extendedInfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            Ptr = reader.ReadSLeb128 ();
            Obj = reader.ReadSLeb128 ();
            Size = reader.ReadULeb128 ();
            if ((extendedInfo & TYPE_ALLOC_BT) != 0)
                Backtrace = new Backtrace (reader);
        }
开发者ID:slluis,项目名称:heap-shot,代码行数:15,代码来源:Event.cs

示例3: HandleCreatedGcEvent

		HandleCreatedGcEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			HandleType = (System.Runtime.InteropServices.GCHandleType)reader.ReadULeb128 ();
			Handle = reader.ReadULeb128 ();
			ObjAddr = reader.ReadSLeb128 ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:Event.cs

示例4: UBinSampleEvent

 public UBinSampleEvent(BinaryReader reader)
 {
     TimeDiff = reader.ReadULeb128 ();
     Address = reader.ReadSLeb128 ();
     Offset = reader.ReadULeb128 ();
     Size = reader.ReadULeb128 ();
     Name = reader.ReadNullTerminatedString ();
 }
开发者ID:slluis,项目名称:heap-shot,代码行数:8,代码来源:Event.cs

示例5: ResizeGcEvent

        public readonly ulong HeapSize; // new heap size

        #endregion Fields

        #region Constructors

        ResizeGcEvent(BinaryReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            HeapSize = reader.ReadULeb128 ();
        }
开发者ID:slluis,项目名称:heap-shot,代码行数:11,代码来源:Event.cs

示例6: MonitiorEvent

        public readonly long Object; //  the lock object as a difference from obj_base

        #endregion Fields

        #region Constructors

        MonitiorEvent(BinaryReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            Object = reader.ReadSLeb128 ();
            byte ev = (byte)((exinfo >> 4) & 0x3);
            if (ev == MONO_PROFILER_MONITOR_CONTENTION && (exinfo & TYPE_MONITOR_BT) == TYPE_MONITOR_BT) {
                Backtrace = new Backtrace (reader);
            }
        }
开发者ID:slluis,项目名称:heap-shot,代码行数:15,代码来源:Event.cs

示例7: MetadataEvent

        public readonly long Pointer; // pointer of the metadata type depending on mtype

        #endregion Fields

        #region Constructors

        MetadataEvent(BinaryReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            MType = (MetaDataType)reader.ReadByte ();
            Pointer = reader.ReadSLeb128 ();
            switch (MType) {
            case MetaDataType.Class:
                Image = reader.ReadSLeb128 ();
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Image:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Thread:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            }
        }
开发者ID:slluis,项目名称:heap-shot,代码行数:27,代码来源:Event.cs

示例8: HeapEvent

 HeapEvent(BinaryReader reader, byte exinfo)
 {
     if (exinfo == TYPE_HEAP_START) {
         Type = EventType.Start;
         TimeDiff = reader.ReadULeb128 ();
     } else if (exinfo == TYPE_HEAP_END) {
         Type = EventType.End;
         TimeDiff = reader.ReadULeb128 ();
     } else if (exinfo == TYPE_HEAP_ROOT) {
         Type = EventType.Root;
         ulong nroots = reader.ReadULeb128 ();
         reader.ReadULeb128 (); // gcs
         RootRefs = new long [nroots];
         RootRefTypes = new RootType [nroots];
         RootRefExtraInfos = new ulong [nroots];
         for (ulong n=0; n<nroots; n++) {
             RootRefs [n] = reader.ReadSLeb128 ();
             RootRefTypes [n] = (RootType) reader.ReadULeb128 ();
             RootRefExtraInfos [n] = reader.ReadULeb128 ();
         }
     } else if (exinfo == TYPE_HEAP_OBJECT) {
         Type = EventType.Object;
         Object = reader.ReadSLeb128 ();
         Class = reader.ReadSLeb128 ();
         Size = reader.ReadULeb128 ();
         ulong num = reader.ReadULeb128 ();
         ObjectRefs = new long[num];
         RelOffset = new ulong[num];
         for (ulong i = 0; i < num; i++) {
             RelOffset [i] = reader.ReadULeb128 ();
             ObjectRefs [i] = reader.ReadSLeb128 ();
         }
     }
 }
开发者ID:slluis,项目名称:heap-shot,代码行数:34,代码来源:Event.cs

示例9: HandleCreatedGcEvent

        public readonly long ObjAddr; // object pointer differences from obj_base

        #endregion Fields

        #region Constructors

        HandleCreatedGcEvent(BinaryReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            HandleType = reader.ReadULeb128 ();
            Handle = reader.ReadULeb128 ();
            ObjAddr = reader.ReadSLeb128 ();
        }
开发者ID:slluis,项目名称:heap-shot,代码行数:13,代码来源:Event.cs

示例10: MethodJitEvent

		public MethodJitEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			Method = reader.ReadSLeb128 ();
			CodeAddress = reader.ReadSLeb128 ();
			CodeSize = reader.ReadULeb128 ();
			Name = reader.ReadNullTerminatedString ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:8,代码来源:Event.cs

示例11: MethodExcLeaveEvent

		public MethodExcLeaveEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			Method = reader.ReadSLeb128 ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:Event.cs

示例12: MetaDataThreadEvent

		internal MetaDataThreadEvent (BinaryReader reader)
		{
			Flags = reader.ReadULeb128 ();
			Name = reader.ReadNullTerminatedString ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:Event.cs

示例13: MetaDataClassEvent

		internal MetaDataClassEvent (BinaryReader reader)
		{
			Image = reader.ReadSLeb128 ();
			Flags = reader.ReadULeb128 ();
			Name = reader.ReadNullTerminatedString ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:6,代码来源:Event.cs

示例14: Read

		public static new Event Read (BinaryReader reader)
		{
			ulong timeDiff = reader.ReadULeb128 ();
			byte type = reader.ReadByte ();
			long pointer = reader.ReadSLeb128 ();
			
			MetadataEvent result;
			switch (type) {
			case TYPE_CLASS:
				result = new MetaDataClassEvent (reader);
				break;
			case TYPE_IMAGE:
				result = new MetaDataImageEvent (reader);
				break;
			case TYPE_ASSEMBLY:
				result = new MetaDataAssemblyEvent ();
				break;
			case TYPE_DOMAIN:
				result = new MetaDataDomainEvent ();
				break;
			case TYPE_THREAD:
				result = new MetaDataThreadEvent (reader);
				break;
			default:
				throw new InvalidOperationException ("Unknown metadata event type:" + type);
			}
			result.TimeDiff = timeDiff;
			result.Pointer = pointer;
			return result;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:30,代码来源:Event.cs

示例15: HandleDestroyedGcEvent

		HandleDestroyedGcEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			HandleType = (System.Runtime.InteropServices.GCHandleType)reader.ReadULeb128 ();
			Handle = reader.ReadULeb128 ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:6,代码来源:Event.cs


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