summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-28 15:46:54 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-28 15:46:54 +0000
commita9882cee50d3ba5716ca39ba831b43ea82c34183 (patch)
tree8b8d40a7af353787acc35496d9f795feaae11ef0 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
parenta8833f0c28c86c86d1d059484fe0f44d371eaa47 (diff)
downloadbcm5719-llvm-a9882cee50d3ba5716ca39ba831b43ea82c34183.tar.gz
bcm5719-llvm-a9882cee50d3ba5716ca39ba831b43ea82c34183.zip
llgs: add proper exec support for Linux.
This change: * properly captures execs in NativeProcessLinux. * clears out all non-main-thread thread metadata in NativeProcessLinux on exec. * adds a DidExec() method to the NativeProcessProtocol delegate. * clears out the auxv data cache when we exec (on Linux). This is a small part of the llgs for local Linux debugging work going on here: https://github.com/tfiala/lldb/tree/dev-llgs-local I'm breaking it into small patches. llvm-svn: 216670
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp23
1 files changed, 23 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
+}
OpenPOWER on IntegriCloud