예제 #1
0
        private void TryEnterBreakmode(IDebugResponse response)
        {
            SendRegistersResponse registersResponse = response as SendRegistersResponse;

            if (registersResponse == null)
            {
                return;
            }

            currentRegisters = registersResponse.ToRegisters();
            breakMode        = true;
        }
예제 #2
0
        public static IDebugResponse CreateResponse(DebugCommand command)
        {
            IDebugResponse response = null;

            switch (command)
            {
            case DebugCommand.Continue:
                response = new DebugResponse <ContinueRequest>();
                break;

            case DebugCommand.ReceiveRegisters:
                response = new DebugResponse <ReceiveRegistersRequest>();
                break;

            case DebugCommand.WriteMemory:
                return(null);

            //response = new DebugResponse<WriteMemoryRequest>();
            case DebugCommand.ReadMemory:
                response = new ReadMemoryResponse();
                break;

            case DebugCommand.SendRegisters:
                response = new SendRegistersResponse();
                break;

            case DebugCommand.DownloadScreen:
                response = new DownloadScreenResponse();
                break;

            default:
                return(null);
            }
            response.AddBytes(new byte[1] {
                (byte)command
            });
            return(response);
        }