Exemplo n.º 1
0
       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;
       }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
 }
Exemplo n.º 5
0
 public static void StartGDBServer(this IControllableCPU cpu, [AutoParameter] Machine machine, int port)
 {
     GDB.CreateAndListenOnPort(port, cpu, machine);
 }