summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h')
-rw-r--r--contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h77
1 files changed, 36 insertions, 41 deletions
diff --git a/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index 7379bb3..2a01bce 100644
--- a/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -12,9 +12,9 @@
// C Includes
// C++ Includes
-#include <list>
#include <string>
#include <queue>
+#include <vector>
// Other libraries and framework includes
// Project includes
@@ -25,6 +25,7 @@
#include "lldb/Host/Mutex.h"
#include "lldb/Host/Predicate.h"
#include "lldb/Host/TimeValue.h"
+#include "lldb/Interpreter/Args.h"
#include "Utility/StringExtractorGDBRemote.h"
@@ -94,14 +95,10 @@ public:
uint32_t m_saved_timeout;
};
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
GDBRemoteCommunication(const char *comm_name,
const char *listener_name);
- virtual
- ~GDBRemoteCommunication();
+ ~GDBRemoteCommunication() override;
PacketResult
GetAck ();
@@ -117,12 +114,13 @@ public:
size_t payload_length);
bool
- GetSequenceMutex (Mutex::Locker& locker, const char *failure_message = NULL);
+ GetSequenceMutex(Mutex::Locker& locker, const char *failure_message = nullptr);
PacketType
CheckForPacket (const uint8_t *src,
size_t src_len,
StringExtractorGDBRemote &packet);
+
bool
IsRunning() const
{
@@ -162,21 +160,22 @@ public:
{
return m_packet_timeout * TimeValue::MicroSecPerSec;
}
+
//------------------------------------------------------------------
// Start a debugserver instance on the current host using the
// supplied connection URL.
//------------------------------------------------------------------
Error
- StartDebugserverProcess (const char *hostname,
- uint16_t in_port, // If set to zero, then out_port will contain the bound port on exit
- ProcessLaunchInfo &launch_info,
- uint16_t &out_port);
+ StartDebugserverProcess(const char *url,
+ Platform *platform, // If non nullptr, then check with the platform for the GDB server binary if it can't be located
+ ProcessLaunchInfo &launch_info,
+ uint16_t *port,
+ const Args& inferior_args = Args());
void
DumpHistory(Stream &strm);
protected:
-
class History
{
public:
@@ -223,6 +222,7 @@ protected:
AddPacket (char packet_char,
PacketType type,
uint32_t bytes_transmitted);
+
void
AddPacket (const std::string &src,
uint32_t src_len,
@@ -241,7 +241,7 @@ protected:
return m_dumped_to_log;
}
-protected:
+ protected:
uint32_t
GetFirstSavedPacketIndex () const
{
@@ -275,13 +275,30 @@ protected:
return i % m_packets.size();
}
-
std::vector<Entry> m_packets;
uint32_t m_curr_idx;
uint32_t m_total_packet_count;
mutable bool m_dumped_to_log;
};
+ uint32_t m_packet_timeout;
+ uint32_t m_echo_number;
+ LazyBool m_supports_qEcho;
+#ifdef ENABLE_MUTEX_ERROR_CHECKING
+ TrackingMutex m_sequence_mutex;
+#else
+ Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time
+#endif
+ Predicate<bool> m_public_is_running;
+ Predicate<bool> m_private_is_running;
+ History m_history;
+ bool m_send_acks;
+ bool m_is_platform; // Set to true if this class represents a platform,
+ // false if this class represents a debug session for
+ // a single process
+
+ CompressionType m_compression_type;
+
PacketResult
SendPacket (const char *payload,
size_t payload_length);
@@ -321,27 +338,6 @@ protected:
bool
DecompressPacket ();
- //------------------------------------------------------------------
- // Classes that inherit from GDBRemoteCommunication can see and modify these
- //------------------------------------------------------------------
- uint32_t m_packet_timeout;
- uint32_t m_echo_number;
- LazyBool m_supports_qEcho;
-#ifdef ENABLE_MUTEX_ERROR_CHECKING
- TrackingMutex m_sequence_mutex;
-#else
- Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time
-#endif
- Predicate<bool> m_public_is_running;
- Predicate<bool> m_private_is_running;
- History m_history;
- bool m_send_acks;
- bool m_is_platform; // Set to true if this class represents a platform,
- // false if this class represents a debug session for
- // a single process
-
- CompressionType m_compression_type;
-
Error
StartListenThread (const char *hostname = "127.0.0.1", uint16_t port = 0);
@@ -361,10 +357,12 @@ protected:
// This method is defined as part of communication.h
// when the read thread gets any bytes it will pass them on to this function
- virtual void AppendBytesToCache (const uint8_t * bytes, size_t len, bool broadcast, lldb::ConnectionStatus status);
+ void AppendBytesToCache(const uint8_t * bytes,
+ size_t len,
+ bool broadcast,
+ lldb::ConnectionStatus status) override;
private:
-
std::queue<StringExtractorGDBRemote> m_packet_queue; // The packet queue
lldb_private::Mutex m_packet_queue_mutex; // Mutex for accessing queue
Condition m_condition_queue_not_empty; // Condition variable to wait for packets
@@ -372,13 +370,10 @@ private:
HostThread m_listen_thread;
std::string m_listen_url;
- //------------------------------------------------------------------
- // For GDBRemoteCommunication only
- //------------------------------------------------------------------
DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunication);
};
} // namespace process_gdb_remote
} // namespace lldb_private
-#endif // liblldb_GDBRemoteCommunication_h_
+#endif // liblldb_GDBRemoteCommunication_h_
OpenPOWER on IntegriCloud