diff options
Diffstat (limited to 'source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h')
| -rw-r--r-- | source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h | 43 | 
1 files changed, 35 insertions, 8 deletions
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index a1077957c6a62..d8361113ddc84 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -35,6 +35,19 @@ public:      {          eBroadcastBitRunPacketSent = kLoUserBroadcastBit      }; +     +    enum class PacketResult +    { +        Success = 0,        // Success +        ErrorSendFailed,    // Error sending the packet +        ErrorSendAck,       // Didn't get an ack back after sending a packet +        ErrorReplyFailed,   // Error getting the reply +        ErrorReplyTimeout,  // Timed out waiting for reply +        ErrorReplyInvalid,  // Got a reply but it wasn't valid for the packet that was sent +        ErrorReplyAck,      // Sending reply ack failed +        ErrorDisconnected,  // We were disconnected +        ErrorNoSequenceLock // We couldn't get the sequence lock for a multi-packet request +    };      //------------------------------------------------------------------      // Constructors and Destructors      //------------------------------------------------------------------ @@ -45,7 +58,7 @@ public:      virtual      ~GDBRemoteCommunication(); -    char +    PacketResult      GetAck ();      size_t @@ -109,9 +122,10 @@ public:      // supplied connection URL.      //------------------------------------------------------------------      lldb_private::Error -    StartDebugserverProcess (const char *connect_url, -                             const char *unix_socket_name, -                             lldb_private::ProcessLaunchInfo &launch_info);  +    StartDebugserverProcess (const char *hostname, +                             uint16_t in_port, // If set to zero, then out_port will contain the bound port on exit +                             lldb_private::ProcessLaunchInfo &launch_info, +                             uint16_t &out_port);      void      DumpHistory(lldb_private::Stream &strm); @@ -223,15 +237,15 @@ protected:          mutable bool m_dumped_to_log;      }; -    size_t +    PacketResult      SendPacket (const char *payload,                  size_t payload_length); -    size_t +    PacketResult      SendPacketNoLock (const char *payload,                         size_t payload_length); -    size_t +    PacketResult      WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtractorGDBRemote &response,                                                   uint32_t timeout_usec); @@ -242,7 +256,7 @@ protected:      // Classes that inherit from GDBRemoteCommunication can see and modify these      //------------------------------------------------------------------      uint32_t m_packet_timeout; -#ifdef LLDB_CONFIGURATION_DEBUG +#ifdef ENABLE_MUTEX_ERROR_CHECKING      lldb_private::TrackingMutex m_sequence_mutex;  #else      lldb_private::Mutex m_sequence_mutex;    // Restrict access to sending/receiving packets to a single thread at a time @@ -256,9 +270,22 @@ protected:                          // a single process +    lldb_private::Error +    StartListenThread (const char *hostname = "localhost", +                       uint16_t port = 0); + +    bool +    JoinListenThread (); +    static lldb::thread_result_t +    ListenThread (lldb::thread_arg_t arg);  private: +     +    lldb::thread_t m_listen_thread; +    std::string m_listen_url; +     +      //------------------------------------------------------------------      // For GDBRemoteCommunication only      //------------------------------------------------------------------  | 
