1 //===-- GDBRemoteCommunicationServer.h --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_GDBRemoteCommunicationServer_h_
11 #define liblldb_GDBRemoteCommunicationServer_h_
15 // Other libraries and framework includes
17 #include "lldb/Target/Process.h"
19 #include "GDBRemoteCommunication.h"
21 class ProcessGDBRemote;
22 class StringExtractorGDBRemote;
24 class GDBRemoteCommunicationServer : public GDBRemoteCommunication
29 eBroadcastBitRunPacketSent = kLoUserBroadcastBit
31 //------------------------------------------------------------------
32 // Constructors and Destructors
33 //------------------------------------------------------------------
34 GDBRemoteCommunicationServer(bool is_platform);
37 ~GDBRemoteCommunicationServer();
40 GetPacketAndSendResponse (uint32_t timeout_usec,
41 lldb_private::Error &error,
46 GetThreadSuffixSupported ()
51 // After connecting, do a little handshake with the client to make sure
52 // we are at least communicating
54 HandshakeWithClient (lldb_private::Error *error_ptr);
56 // Set both ports to zero to let the platform automatically bind to
57 // a port chosen by the OS.
59 SetPortRange (uint16_t lo_port_num, uint16_t hi_port_num)
61 m_lo_port_num = lo_port_num;
62 m_hi_port_num = hi_port_num;
66 //typedef std::map<uint16_t, lldb::pid_t> PortToPIDMap;
68 lldb::thread_t m_async_thread;
69 lldb_private::ProcessLaunchInfo m_process_launch_info;
70 lldb_private::Error m_process_launch_error;
71 lldb_private::ProcessInstanceInfoList m_proc_infos;
72 uint32_t m_proc_infos_index;
73 uint16_t m_lo_port_num;
74 uint16_t m_hi_port_num;
75 //PortToPIDMap m_port_to_pid_map;
78 SendUnimplementedResponse (const char *packet);
81 SendErrorResponse (uint8_t error);
87 Handle_A (StringExtractorGDBRemote &packet);
90 Handle_qLaunchSuccess (StringExtractorGDBRemote &packet);
93 Handle_qHostInfo (StringExtractorGDBRemote &packet);
96 Handle_qLaunchGDBServer (StringExtractorGDBRemote &packet);
99 Handle_qProcessInfoPID (StringExtractorGDBRemote &packet);
102 Handle_qfProcessInfo (StringExtractorGDBRemote &packet);
105 Handle_qsProcessInfo (StringExtractorGDBRemote &packet);
108 Handle_qC (StringExtractorGDBRemote &packet);
111 Handle_qUserName (StringExtractorGDBRemote &packet);
114 Handle_qGroupName (StringExtractorGDBRemote &packet);
117 Handle_qSpeedTest (StringExtractorGDBRemote &packet);
120 Handle_QEnvironment (StringExtractorGDBRemote &packet);
123 Handle_QSetDisableASLR (StringExtractorGDBRemote &packet);
126 Handle_QSetWorkingDir (StringExtractorGDBRemote &packet);
129 Handle_QStartNoAckMode (StringExtractorGDBRemote &packet);
132 Handle_QSetSTDIN (StringExtractorGDBRemote &packet);
135 Handle_QSetSTDOUT (StringExtractorGDBRemote &packet);
138 Handle_QSetSTDERR (StringExtractorGDBRemote &packet);
141 //------------------------------------------------------------------
142 // For GDBRemoteCommunicationServer only
143 //------------------------------------------------------------------
144 DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationServer);
147 #endif // liblldb_GDBRemoteCommunicationServer_h_