diff options
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 23 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index 4d38a07302c..ffcdd169eb9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -1094,6 +1094,12 @@ GDBRemoteCommunicationServer::ProcessStateChanged (lldb_private::NativeProcessPr m_inferior_prev_state = state; } +void +GDBRemoteCommunicationServer::DidExec (NativeProcessProtocol *process) +{ + ClearProcessSpecificData (); +} + GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServer::SendONotification (const char *buffer, uint32_t len) { @@ -4289,3 +4295,20 @@ GDBRemoteCommunicationServer::GetNextSavedRegistersID () return m_next_saved_registers_id++; } +void +GDBRemoteCommunicationServer::ClearProcessSpecificData () +{ + Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS|GDBR_LOG_PROCESS)); + if (log) + log->Printf ("GDBRemoteCommunicationServer::%s()", __FUNCTION__); + + // Clear any auxv cached data. + // *BSD impls should be able to do this too. +#if defined(__linux__) + if (log) + log->Printf ("GDBRemoteCommunicationServer::%s clearing auxv buffer (previously %s)", + __FUNCTION__, + m_active_auxv_buffer_sp ? "was set" : "was not set"); + m_active_auxv_buffer_sp.reset (); +#endif +} diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h index 412b591e6ec..13c037c0287 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h @@ -218,6 +218,9 @@ public: void ProcessStateChanged (lldb_private::NativeProcessProtocol *process, lldb::StateType state) override; + void + DidExec (lldb_private::NativeProcessProtocol *process) override; + protected: lldb::PlatformSP m_platform_sp; lldb::thread_t m_async_thread; @@ -534,6 +537,9 @@ private: void MaybeCloseInferiorTerminalConnection (); + void + ClearProcessSpecificData (); + //------------------------------------------------------------------ // For GDBRemoteCommunicationServer only //------------------------------------------------------------------ |