diff options
author | emaste <emaste@FreeBSD.org> | 2014-02-18 16:23:10 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-02-18 16:23:10 +0000 |
commit | 6beac4fcf9e5327f07c0fefd527180124438096a (patch) | |
tree | 95cb16075f0af1b3a05b9b84eb18dda8e6c903e9 /source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h | |
parent | f087960a1097db2a1ef14a88963f8785df239aaa (diff) | |
download | FreeBSD-src-6beac4fcf9e5327f07c0fefd527180124438096a.zip FreeBSD-src-6beac4fcf9e5327f07c0fefd527180124438096a.tar.gz |
Import lldb as of SVN r201577 (git 2bdc2f6)
(A number of files not required for the FreeBSD build have been removed.)
Sponsored by: DARPA, AFRL
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 a107795..d836111 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 //------------------------------------------------------------------ |