public GDB(int port, IControllableCPU cpu, Machine machine) { this.machine = machine; this.cpu = cpu; line_l = new List<byte>(); this.mode = 0; this.terminal = new SocketServerProvider(); terminal.DataReceived += OnByteWritten; terminal.Start(port); cpu.Halted += OnHalted; Port = port; }
public GDB(int port, IControllableCPU cpu, Machine machine) { this.machine = machine; this.cpu = cpu; line_l = new StringBuilder(); this.mode = 0; this.terminal = new SocketServerProvider(); terminal.DataReceived += OnByteWritten; terminal.Start(port); cpu.Halted += OnHalted; Port = port; }
public static void CreateAndListenOnPort(int port, IControllableCPU cpu, Machine machine) { if (gdbs.ContainsKey(cpu)) { throw new RecoverableException(string.Format("GDB server already started for this cpu on port: {0}", gdbs[cpu].Port)); } try { gdbs.Add(cpu, new GDB(port, cpu, machine)); } catch (SocketException e) { throw new RecoverableException(string.Format("Could not start GDB server: {0}", e.Message)); } }
// this is to support Python integration public static void SetRegisterUnsafeUlong(this IControllableCPU cpu, int register, ulong value) { cpu.SetRegisterUnsafe(register, value); }
public static void StartGDBServer(this IControllableCPU cpu, [AutoParameter] Machine machine, int port) { GDB.CreateAndListenOnPort(port, cpu, machine); }