コード例 #1
0
ファイル: OutfileReader.cs プロジェクト: facemao3/heap-buddy
        private void ReadLogFileChunk_Backtrace(BinaryReader reader)
        {
            uint code;
            code = reader.ReadUInt32 ();

            uint type_code;
            type_code = reader.ReadUInt32 ();

            int n_frames;
            n_frames = reader.ReadInt16 ();

            if (i_backtrace >= n_backtraces) {
                for (int i = 0; i < n_frames; ++i) {
                    reader.ReadUInt32 (); // skip method code
                    reader.ReadUInt32 (); // skip native offset
                }
                return;
            }

            Backtrace backtrace;
            backtrace = new Backtrace (code, this);
            backtraces [i_backtrace] = backtrace;

            backtrace_codes [i_backtrace] = code;
            backtrace_type_codes [i_backtrace] = type_code;

            Frame [] frames = new Frame [n_frames];
            backtrace.Frames = frames;

            for (int i = 0; i < n_frames; ++i) {
                frames [i].MethodCode = reader.ReadUInt32 ();
                frames [i].IlOffset = reader.ReadUInt32 ();
            }

            ++i_backtrace;
        }
コード例 #2
0
ファイル: OutfileReader.cs プロジェクト: facemao3/heap-buddy
        public Frame[] GetFrames(uint backtrace_code)
        {
            lazy_reader.BaseStream.Seek (backtrace_pos [backtrace_code], SeekOrigin.Begin);

            int length;
            length = lazy_reader.ReadInt32 ();

            Frame [] frames;
            frames = new Frame [length];
            for (int i = 0; i < length; ++i) {
                frames [i].MethodCode = lazy_reader.ReadUInt32 ();
                frames [i].IlOffset = lazy_reader.ReadUInt32 ();
            }

            for (int i = 0; i < length; ++i)
                GetMethod (frames [i].MethodCode,
                       out frames [i].MethodName,
                       out frames [i].MethodArguments);

            return frames;
        }