Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 1 | //===-- GDBRemoteCommunicationServer.h --------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef liblldb_GDBRemoteCommunicationServer_h_ |
| 11 | #define liblldb_GDBRemoteCommunicationServer_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | // Other libraries and framework includes |
| 16 | // Project includes |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 17 | #include "lldb/Target/Process.h" |
| 18 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 19 | #include "GDBRemoteCommunication.h" |
| 20 | |
| 21 | class ProcessGDBRemote; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 22 | class StringExtractorGDBRemote; |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 23 | |
| 24 | class GDBRemoteCommunicationServer : public GDBRemoteCommunication |
| 25 | { |
| 26 | public: |
| 27 | enum |
| 28 | { |
| 29 | eBroadcastBitRunPacketSent = kLoUserBroadcastBit |
| 30 | }; |
| 31 | //------------------------------------------------------------------ |
| 32 | // Constructors and Destructors |
| 33 | //------------------------------------------------------------------ |
| 34 | GDBRemoteCommunicationServer(); |
| 35 | |
| 36 | virtual |
| 37 | ~GDBRemoteCommunicationServer(); |
| 38 | |
| 39 | bool |
Greg Clayton | cb8977d | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 40 | GetPacketAndSendResponse (const lldb_private::TimeValue* timeout_ptr, |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 41 | lldb_private::Error &error, |
Greg Clayton | cb8977d | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 42 | bool &interrupt, |
| 43 | bool &quit); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 44 | |
| 45 | virtual bool |
| 46 | GetThreadSuffixSupported () |
| 47 | { |
| 48 | return true; |
| 49 | } |
| 50 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 51 | // After connecting, do a little handshake with the client to make sure |
| 52 | // we are at least communicating |
| 53 | bool |
| 54 | HandshakeWithClient (lldb_private::Error *error_ptr); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 55 | |
| 56 | protected: |
| 57 | lldb::thread_t m_async_thread; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 58 | lldb_private::ProcessInfoList m_proc_infos; |
| 59 | uint32_t m_proc_infos_index; |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 60 | |
| 61 | size_t |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 62 | SendUnimplementedResponse (const char *packet); |
| 63 | |
| 64 | size_t |
| 65 | SendErrorResponse (uint8_t error); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 66 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 67 | size_t |
| 68 | SendOKResponse (); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 69 | |
| 70 | bool |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 71 | Handle_qHostInfo (StringExtractorGDBRemote &packet); |
| 72 | |
| 73 | bool |
| 74 | Handle_qProcessInfoPID (StringExtractorGDBRemote &packet); |
| 75 | |
| 76 | bool |
| 77 | Handle_qfProcessInfo (StringExtractorGDBRemote &packet); |
| 78 | |
| 79 | bool |
| 80 | Handle_qsProcessInfo (StringExtractorGDBRemote &packet); |
| 81 | |
| 82 | bool |
| 83 | Handle_qUserName (StringExtractorGDBRemote &packet); |
| 84 | |
| 85 | bool |
| 86 | Handle_qGroupName (StringExtractorGDBRemote &packet); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 87 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 88 | bool |
Greg Clayton | 06d7cc8 | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 89 | Handle_qSpeedTest (StringExtractorGDBRemote &packet); |
| 90 | |
| 91 | bool |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 92 | Handle_QStartNoAckMode (StringExtractorGDBRemote &packet); |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 93 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 94 | private: |
| 95 | //------------------------------------------------------------------ |
| 96 | // For GDBRemoteCommunicationServer only |
| 97 | //------------------------------------------------------------------ |
| 98 | DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationServer); |
| 99 | }; |
| 100 | |
| 101 | #endif // liblldb_GDBRemoteCommunicationServer_h_ |