private CPUTracer EnsureTracer(Arm cpu) { CPUTracer tracer; var tracerName = FindTracerName(cpu); if(!EmulationManager.Instance.CurrentEmulation.TryGetFromBag(tracerName, out tracer)) { cpu.CreateCPUTracer(tracerName); } if(!EmulationManager.Instance.CurrentEmulation.TryGetFromBag(tracerName, out tracer)) { throw new RecoverableException("Could not initialize CPUTracer."); } return tracer; }
public CPUTracer(Arm cpu) { this.cpu = cpu; this.bus = cpu.Bus; }
private string FindTracerName(Arm cpu) { string cpuName; if(!cpu.Bus.Machine.TryGetAnyName(cpu, out cpuName)) { throw new Exception("This should never have happened!"); } return "{0}.{1}-{2}".FormatWith(EmulationManager.Instance.CurrentEmulation[cpu.Bus.Machine], cpuName, TracerName); }