public MIResultRecord Request(string command, int timeout = -1) { MIResultRecord resultRecord = null; Logger.LogLine("> " + command); if (!Debuggee.DebuggerClient.Send(command)) { throw new DebuggerNotResponsesException(); } while (true) { string[] response = Debuggee.DebuggerClient.Receive(timeout); if (response == null) { throw new DebuggerNotResponsesException(); } foreach (string line in response) { Logger.LogLine("< " + line); } // we could get async record, in this case we could have two "(gdb)" prompts one by one // NOTE in this case we have only one line response, that contain prompt only if (MIParser.IsEnd(response[0])) { continue; } MIOutput output = MIParser.ParseOutput(response); foreach (var record in output.OutOfBandRecords) { EventQueue.Enqueue(record); } if (output.ResultRecord != null) { resultRecord = output.ResultRecord; break; } } return(resultRecord); }
public MIResultRecord Request(string command, int timeout = -1) { MIResultRecord resultRecord = null; Logger.LogLine("> " + command); if (!Debuggee.DebuggerClient.Send(command)) { throw new DebuggerNotResponsesException(); } while (true) { string[] response = Debuggee.DebuggerClient.Receive(timeout); if (response == null) { throw new DebuggerNotResponsesException(); } foreach (string line in response) { Logger.LogLine("< " + line); } MIOutput output = MIParser.ParseOutput(response); if (output.ResultRecord != null) { resultRecord = output.ResultRecord; break; } } return(resultRecord); }
public MIOutput(MIOutOfBandRecord[] outOfBandRecords, MIResultRecord resultRecord) { OutOfBandRecords = outOfBandRecords; ResultRecord = resultRecord; }