diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h')
-rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 17ee4130dc34..5187a953f957 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -11,6 +11,7 @@ #include <mutex> #include <unordered_map> +#include <unordered_set> #include "lldb/Core/Communication.h" #include "lldb/Host/MainLoop.h" @@ -95,6 +96,7 @@ protected: std::recursive_mutex m_debugged_process_mutex; std::unordered_map<lldb::pid_t, std::unique_ptr<NativeProcessProtocol>> m_debugged_processes; + std::unordered_set<lldb::pid_t> m_vkilled_processes; Communication m_stdio_communication; MainLoop::ReadHandleUP m_stdio_handle_up; @@ -106,6 +108,8 @@ protected: uint32_t m_next_saved_registers_id = 1; bool m_thread_suffix_supported = false; bool m_list_threads_in_stop_reply = false; + bool m_non_stop = false; + std::deque<std::string> m_stop_notification_queue; NativeProcessProtocol::Extension m_extensions_supported = {}; @@ -113,12 +117,22 @@ protected: PacketResult SendWResponse(NativeProcessProtocol *process); - PacketResult SendStopReplyPacketForThread(lldb::tid_t tid); + StreamString PrepareStopReplyPacketForThread(NativeThreadProtocol &thread); - PacketResult SendStopReasonForState(lldb::StateType process_state); + PacketResult SendStopReplyPacketForThread(NativeProcessProtocol &process, + lldb::tid_t tid, + bool force_synchronous); + + PacketResult SendStopReasonForState(NativeProcessProtocol &process, + lldb::StateType process_state, + bool force_synchronous); + + void EnqueueStopReplyPackets(lldb::tid_t thread_to_skip); PacketResult Handle_k(StringExtractorGDBRemote &packet); + PacketResult Handle_vKill(StringExtractorGDBRemote &packet); + PacketResult Handle_qProcessInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qC(StringExtractorGDBRemote &packet); @@ -145,6 +159,9 @@ protected: PacketResult Handle_qRegisterInfo(StringExtractorGDBRemote &packet); + void AddProcessThreads(StreamGDBRemote &response, + NativeProcessProtocol &process, bool &had_any); + PacketResult Handle_qfThreadInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qsThreadInfo(StringExtractorGDBRemote &packet); @@ -217,12 +234,20 @@ protected: PacketResult Handle_qSaveCore(StringExtractorGDBRemote &packet); + PacketResult Handle_QNonStop(StringExtractorGDBRemote &packet); + + PacketResult Handle_vStopped(StringExtractorGDBRemote &packet); + + PacketResult Handle_vCtrlC(StringExtractorGDBRemote &packet); + PacketResult Handle_g(StringExtractorGDBRemote &packet); PacketResult Handle_qMemTags(StringExtractorGDBRemote &packet); PacketResult Handle_QMemTags(StringExtractorGDBRemote &packet); + PacketResult Handle_T(StringExtractorGDBRemote &packet); + void SetCurrentThreadID(lldb::tid_t tid); lldb::tid_t GetCurrentThreadID() const; @@ -241,9 +266,16 @@ protected: static std::string XMLEncodeAttributeValue(llvm::StringRef value); - virtual std::vector<std::string> HandleFeatures( + std::vector<std::string> HandleFeatures( const llvm::ArrayRef<llvm::StringRef> client_features) override; + // Provide a response for successful continue action, i.e. send "OK" + // in non-stop mode, no response otherwise. + PacketResult SendContinueSuccessResponse(); + + void AppendThreadIDToResponse(Stream &response, lldb::pid_t pid, + lldb::tid_t tid); + private: llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> BuildTargetXml(); @@ -269,15 +301,6 @@ private: void StopSTDIOForwarding(); - // Read thread-id from packet. If the thread-id is correct, returns it. - // Otherwise, returns the error. - // - // If allow_all is true, then the pid/tid value of -1 ('all') will be allowed. - // In any case, the function assumes that exactly one inferior is being - // debugged and rejects pid values that do no match that inferior. - llvm::Expected<lldb::tid_t> ReadTid(StringExtractorGDBRemote &packet, - bool allow_all, lldb::pid_t default_pid); - // Call SetEnabledExtensions() with appropriate flags on the process. void SetEnabledExtensions(NativeProcessProtocol &process); |