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


C# BinaryReader.ReadSLeb128方法代碼示例

本文整理匯總了C#中System.IO.BinaryReader.ReadSLeb128方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryReader.ReadSLeb128方法的具體用法?C# BinaryReader.ReadSLeb128怎麽用?C# BinaryReader.ReadSLeb128使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IO.BinaryReader的用法示例。


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: ExceptionEvent

        public readonly long Object; // the object that was thrown as a difference from obj_base If the TYPE_EXCEPTION_BT flag is set, a backtrace follows.

        #endregion Fields

        #region Constructors

        ExceptionEvent(BinaryReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            byte subtype = (byte)(exinfo & 0x70);
            if (subtype == TYPE_CLAUSE) {
                ClauseType = reader.ReadULeb128 ();
                ClauseNum = reader.ReadULeb128 ();
                Method = reader.ReadSLeb128 ();
            } else if (subtype == TYPE_THROW) {
                Object = reader.ReadSLeb128 ();
                if ((exinfo & TYPE_EXCEPTION_BT) == TYPE_EXCEPTION_BT)
                    Backtrace = new Backtrace (reader);
            }
        }
開發者ID:slluis,項目名稱:heap-shot,代碼行數:20,代碼來源:Event.cs

示例6: 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

示例7: 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

示例8: MoveGcEvent

        public readonly long[] ObjAddr; //  num_objects object pointer differences from obj_base

        #endregion Fields

        #region Constructors

        MoveGcEvent(BinaryReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            ulong num = reader.ReadULeb128 ();
            ObjAddr = new long[num];
            for (ulong i = 0; i < num; i++) {
                ObjAddr [i] = reader.ReadSLeb128 ();
            }
        }
開發者ID:slluis,項目名稱:heap-shot,代碼行數:15,代碼來源:Event.cs

示例9: MethodEvent

 MethodEvent(BinaryReader reader, byte exinfo)
 {
     TimeDiff = reader.ReadULeb128 ();
     Method = reader.ReadSLeb128 ();
     Type = (MethodType)exinfo;
     if (Type == MethodType.Jit) {
         CodeAddress = reader.ReadSLeb128 ();
         CodeSize = reader.ReadULeb128 ();
         Name = reader.ReadNullTerminatedString ();
     }
 }
開發者ID:slluis,項目名稱:heap-shot,代碼行數:11,代碼來源:Event.cs

示例10: ExceptionThrowEvent

		internal ExceptionThrowEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			Object = reader.ReadSLeb128 ();
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:5,代碼來源:Event.cs

示例11: ExceptionClauseEvent

		internal ExceptionClauseEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			ClauseType = reader.ReadULeb128 ();
			ClauseNum = reader.ReadULeb128 ();
			Method = reader.ReadSLeb128 ();
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:7,代碼來源:Event.cs

示例12: 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

示例13: MethodExcLeaveEvent

		public MethodExcLeaveEvent (BinaryReader reader)
		{
			TimeDiff = reader.ReadULeb128 ();
			Method = reader.ReadSLeb128 ();
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:5,代碼來源:Event.cs

示例14: MetaDataClassEvent

		internal MetaDataClassEvent (BinaryReader reader)
		{
			Image = reader.ReadSLeb128 ();
			Flags = reader.ReadULeb128 ();
			Name = reader.ReadNullTerminatedString ();
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:6,代碼來源:Event.cs

示例15: HitSampleEvent

 public HitSampleEvent(BinaryReader reader)
 {
     SampleType = (SampleType) reader.ReadULeb128 ();
     Timestamp = reader.ReadULeb128 ();
     ulong count = reader.ReadULeb128 ();
     InstructionPointers = new long [count];
     for (uint n=0; n<count; n++)
         InstructionPointers [n] = reader.ReadSLeb128 ();
 }
開發者ID:slluis,項目名稱:heap-shot,代碼行數:9,代碼來源:Event.cs


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