void DisassemblyControl_StateChange(object sender, EventArgs e) { if (program == null || topAddress == null) { Model = new EmptyEditorModel(); } else { ImageSegment segment; if (!program.SegmentMap.TryFindSegment(topAddress, out segment) || segment.MemoryArea == null) { Model = new EmptyEditorModel(); } else { var addr = topAddress; this.dasmModel = new DisassemblyTextModel(program, segment); Model = dasmModel; Model.MoveToLine(addr, 0); } } RecomputeLayout(); base.UpdateScrollbar(); }
public override Tuple <ModelPosition, LineSpan> GenerateSpan() { if (offset >= instrs.Length || offset < 0) { return(null); } var instr = instrs[offset]; ++offset; var asmLine = DisassemblyTextModel.RenderAsmLine( position, program, instr, MachineInstructionWriterOptions.ResolvePcRelativeAddress); if (offset == instrs.Length) { DecorateLastLine(asmLine); } this.position = Pos(instr.Address + instr.Length); return(Tuple.Create(position, asmLine)); }