Exemplo n.º 1
0
        public CodeBlockEntry[] GetCodeBlocks()
        {
            lock (SymbolFile) {
                if (code_blocks != null)
                {
                    return(code_blocks);
                }

                if (CodeBlockTableOffset == 0)
                {
                    return(null);
                }

                MyBinaryReader reader  = SymbolFile.BinaryReader;
                long           old_pos = reader.BaseStream.Position;
                reader.BaseStream.Position = CodeBlockTableOffset;

                int num_code_blocks = reader.ReadLeb128();
                code_blocks = new CodeBlockEntry [num_code_blocks];

                for (int i = 0; i < num_code_blocks; i++)
                {
                    code_blocks [i] = new CodeBlockEntry(i, reader);
                }

                reader.BaseStream.Position = old_pos;
                return(code_blocks);
            }
        }
Exemplo n.º 2
0
        public void StartBlock(CodeBlockEntry.Type type, int start_offset)
        {
            if (_block_stack == null)
            {
                _block_stack = new Stack <CodeBlockEntry> ();
            }

            if (_blocks == null)
            {
                _blocks = new List <CodeBlockEntry> ();
            }

            int parent = CurrentBlock != null ? CurrentBlock.Index : -1;

            CodeBlockEntry block = new CodeBlockEntry(
                _blocks.Count + 1, parent, type, start_offset);

            _block_stack.Push(block);
            _blocks.Add(block);
        }
Exemplo n.º 3
0
        public void EndBlock(int end_offset)
        {
            CodeBlockEntry block = (CodeBlockEntry)_block_stack.Pop();

            block.Close(end_offset);
        }