ReadSLeb128() public method

public ReadSLeb128 ( ) : long
return long
コード例 #1
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly long Object; //  the lock object as a difference from obj_base

        #endregion Fields

        #region Constructors

        MonitiorEvent(LogFileReader 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);
            }
        }
コード例 #2
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly long[] ObjAddr; //  num_objects object pointer differences from obj_base

        #endregion Fields

        #region Constructors

        MoveGcEvent(LogFileReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            ulong num = reader.ReadULeb128 ();
            ObjAddr = new long[num];
            for (ulong i = 0; i < num; i++) {
                ObjAddr [i] = reader.ReadSLeb128 ();
            }
        }
コード例 #3
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly long Pointer; // pointer of the metadata type depending on mtype

        #endregion Fields

        #region Constructors

        MetadataEvent(LogFileReader 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;
            }
        }
コード例 #4
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 MethodEvent(LogFileReader 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 ();
     }
 }
コード例 #5
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 HeapEvent(LogFileReader 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 ();
         }
     }
 }
コード例 #6
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public HitSampleEvent(LogFileReader 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 ();
 }
コード例 #7
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        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(LogFileReader 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);
            }
        }
コード例 #8
0
ファイル: Event.cs プロジェクト: mono/heap-shot
        public readonly long ObjAddr; // object pointer differences from obj_base

        #endregion Fields

        #region Constructors

        HandleCreatedGcEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            HandleType = reader.ReadULeb128 ();
            Handle = reader.ReadULeb128 ();
            ObjAddr = reader.ReadSLeb128 ();
            if (exinfo == TYPE_GC_HANDLE_CREATED_BT)
                new Backtrace (reader);
        }
コード例 #9
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public Backtrace(LogFileReader reader)
 {
     Flags = reader.ReadULeb128 ();
     ulong num = reader.ReadULeb128 ();
     Frame = new long[num];
     for (ulong i = 0; i < num; i++) {
         Frame [i] = reader.ReadSLeb128 ();
     }
 }
コード例 #10
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public CounterValue(LogFileReader reader, ulong index)
 {
     Index = index;
     Type = (uint)reader.ReadULeb128 ();
     switch ((CounterValueType)Type) {
     case CounterValueType.MONO_COUNTER_STRING:
         if (reader.ReadULeb128 () == 1)
             reader.ReadNullTerminatedString ();
         break;
     case CounterValueType.MONO_COUNTER_WORD:
     case CounterValueType.MONO_COUNTER_INT:
     case CounterValueType.MONO_COUNTER_LONG:
         reader.ReadSLeb128 ();
         break;
     case CounterValueType.MONO_COUNTER_UINT:
     case CounterValueType.MONO_COUNTER_ULONG:
         reader.ReadULeb128 ();
         break;
     case CounterValueType.MONO_COUNTER_DOUBLE:
         reader.ReadUInt64 ();
         break;
     default:
         throw new ArgumentException (String.Format("Unknown Counter Value type {0} [0x{0:x8}], for counter at index {3}, near byte {1} [0x{1:x8}] of {2}.", Type, reader.Position, reader.Length, Index));
     }
 }
コード例 #11
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public USymSampleEvent(LogFileReader reader)
 {
     Address = reader.ReadSLeb128 ();
     Size = reader.ReadULeb128 ();
     Name = reader.ReadNullTerminatedString ();
 }
コード例 #12
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public UBinSampleEvent(LogFileReader reader)
 {
     TimeDiff = reader.ReadULeb128 ();
     Address = reader.ReadSLeb128 ();
     Offset = reader.ReadULeb128 ();
     Size = reader.ReadULeb128 ();
     Name = reader.ReadNullTerminatedString ();
 }
コード例 #13
0
ファイル: Event.cs プロジェクト: mono/heap-shot
        public readonly long Pointer; // pointer of the metadata type depending on mtype

        #endregion Fields

        #region Constructors

        MetadataEvent(LogFileReader reader, byte extendedInfo)
        {
            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.Assembly:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Thread:
                Flags = reader.ReadULeb128 ();
                if (reader.Header.Format < 11 || (reader.Header.Format > 10 && extendedInfo == 0)) {
                    Name = reader.ReadNullTerminatedString ();
                }
                break;
            case MetaDataType.Domain:
                Flags = reader.ReadULeb128 ();
                if (extendedInfo == 0)
                    Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Context:
                Flags = reader.ReadULeb128 ();
                Domain = reader.ReadSLeb128 ();
                break;
            default:
                throw new ArgumentException ("Unknown metadata type: " + MType);
            }
        }
コード例 #14
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly ulong Size; // size of the object in the heap

        #endregion Fields

        #region Constructors

        AllocEvent(LogFileReader 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);
        }
コード例 #15
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly long ObjAddr; // object pointer differences from obj_base

        #endregion Fields

        #region Constructors

        HandleCreatedGcEvent(LogFileReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            HandleType = reader.ReadULeb128 ();
            Handle = reader.ReadULeb128 ();
            ObjAddr = reader.ReadSLeb128 ();
        }
コード例 #16
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
 public RuntimeJitHelperEvent(LogFileReader reader)
     : base(reader)
 {
     Type = reader.ReadULeb128 ();
     BufferAddress = reader.ReadSLeb128 ();
     BufferSize = reader.ReadULeb128 ();
     if (Type == (ulong)MonoProfilerCodeBufferType.MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) {
         Name = reader.ReadNullTerminatedString ();
     }
 }
コード例 #17
0
ファイル: Event.cs プロジェクト: mono/heap-shot
        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(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            byte subtype = (byte)(exinfo & ~TYPE_EXCEPTION_BT);
            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);
            } else
                throw new InvalidOperationException ("Unknown exception event type:" + (exinfo & ~TYPE_EXCEPTION_BT));
        }