Example #1
0
            public void Load(TargetBinaryReader dynamic_reader, AddressDomain domain)
            {
                if (is_loaded)
                    throw new InternalError ();

                is_loaded = true;

                address = new MethodAddress (
                    dynamic_reader, domain, File.Architecture);

                SetAddresses (address.StartAddress, address.EndAddress);
                SetMethodBounds (address.MethodStartAddress, address.MethodEndAddress);
                SetLineNumbers (new WrapperLineNumberTable (this, address));
            }
Example #2
0
 public WrapperLineNumberTable(WrapperMethod wrapper, MethodAddress address)
     : base(wrapper.File, wrapper)
 {
     this.wrapper = wrapper;
     this.address = address;
 }
Example #3
0
            static int find_address(MethodAddress address, int il_offset)
            {
                int num_line_numbers = address.LineNumbers.Count;

                for (int i = 0; i < num_line_numbers; i++) {
                    JitLineNumberEntry lne = address.LineNumbers [i];

                    if (lne.Offset < 0)
                        continue;
                    if (lne.Offset >= il_offset)
                        return lne.Address;
                }

                return num_line_numbers > 0 ?
                    address.LineNumbers [num_line_numbers - 1].Address : 0;
            }
Example #4
0
            public void Load(TargetBinaryReader dynamic_reader, AddressDomain domain)
            {
                if (is_loaded)
                    throw new InternalError ();

                is_loaded = true;

                address = new MethodAddress (
                    dynamic_reader, domain, file.Architecture);

                SetAddresses (address.StartAddress, address.EndAddress);
                SetMethodBounds (address.MethodStartAddress, address.MethodEndAddress);

                SetLineNumbers (new MonoMethodLineNumberTable (
                    file, this, source, method, address.LineNumbers.ToArray ()));
            }
Example #5
0
            public static MonoCodeBlock[] CreateBlocks(MonoMethod method,
								    MethodAddress address,
								    C.CodeBlockEntry[] the_blocks,
								    out List<MonoCodeBlock> root_blocks)
            {
                MonoCodeBlock[] blocks = new MonoCodeBlock [the_blocks.Length];
                for (int i = 0; i < blocks.Length; i++) {
                    Block.Type type = (Block.Type) the_blocks [i].BlockType;
                    int start = find_address (address, the_blocks [i].StartOffset);
                    int end = find_address (address, the_blocks [i].EndOffset);
                    blocks [i] = new MonoCodeBlock (i, type, start, end);
                }

                root_blocks = new List<MonoCodeBlock> ();

                for (int i = 0; i < blocks.Length; i++) {
                    if (the_blocks [i].Parent < 0)
                        root_blocks.Add (blocks [i]);
                    else {
                        MonoCodeBlock parent = blocks [the_blocks [i].Parent - 1];
                        blocks [i].Parent = parent;
                        parent.AddChildBlock (blocks [i]);
                    }
                }

                return blocks;
            }