//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public uint SendCommand (string command, int timeout, OnResultRecordDelegate asyncDelegate = null) { // // Keep track of this command, and associated token-id, so results can be tracked asynchronously. // LoggingUtils.Print (string.Format ("[GdbClient] SendAsyncCommand: {0}", command)); if (string.IsNullOrWhiteSpace (command)) { throw new ArgumentNullException ("command"); } if (m_gdbClientInstance == null) { throw new InvalidOperationException ("No GdbClient instance bound"); } m_timeSinceLastOperation.Restart (); AsyncCommandData commandData = new AsyncCommandData (); commandData.Command = command; commandData.ResultDelegate = asyncDelegate; ++m_sessionCommandToken; lock (m_asyncCommandData) { m_asyncCommandData.Add (m_sessionCommandToken, commandData); } // // Prepend (and increment) GDB/MI token. // command = m_sessionCommandToken + command; m_gdbClientInstance.SendCommand (command); m_timeSinceLastOperation.Restart (); return m_sessionCommandToken; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public uint SendCommand (string command, OnResultRecordDelegate asyncDelegate) { return SendCommand (command, 30000, asyncDelegate); }