Block lookup_block(TargetAddress address, Block[] blocks) { foreach (MonoCodeBlock block in blocks) { if ((address < StartAddress + block.StartAddress) || (address >= StartAddress + block.EndAddress)) continue; if (block.Children != null) { Block child = lookup_block (address, block.Children); return child ?? block; } return block; } return null; }
protected MonoCodeBlock(int index, Block.Type type, int start, int end) : base(type, index, start, end) { }
void dump_blocks(Block[] blocks, string ident) { foreach (MonoCodeBlock block in blocks) { Console.WriteLine ("{0} {1}", ident, block); if (block.Children != null) dump_blocks (block.Children, ident + " "); } }