diff options
author | Pavel Labath <labath@google.com> | 2015-07-21 13:20:32 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2015-07-21 13:20:32 +0000 |
commit | 19cbe96a4575ec3ba250914b914b9a0e954308ee (patch) | |
tree | 5c52ab01590881b838358b2cc1d67430a5dd5692 /lldb/source/Plugins/Process/gdb-remote | |
parent | c7749c3acdedc6e09a302622cd29f4bfe4672f3f (diff) | |
download | bcm5719-llvm-19cbe96a4575ec3ba250914b914b9a0e954308ee.tar.gz bcm5719-llvm-19cbe96a4575ec3ba250914b914b9a0e954308ee.zip |
[NativeProcessLinux] Integrate MainLoop
Summary:
This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with
the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of
thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been
reduced by about 40%). It also makes the code simpler, IMHO.
Reviewers: ovyalov, clayborg, tberghammer, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11150
This is a resubmission of r242305 after it was reverted due to bad interactions with the stdio
thread.
llvm-svn: 242783
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 17 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | 3 |
2 files changed, 2 insertions, 18 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 79ed21eb17b..92d3eb742f5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -97,20 +97,6 @@ GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS( RegisterPacketHandlers(); } -//---------------------------------------------------------------------- -// Destructor -//---------------------------------------------------------------------- -GDBRemoteCommunicationServerLLGS::~GDBRemoteCommunicationServerLLGS() -{ - Mutex::Locker locker (m_debugged_process_mutex); - - if (m_debugged_process_sp) - { - m_debugged_process_sp->Terminate (); - m_debugged_process_sp.reset (); - } -} - void GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers() { @@ -226,6 +212,7 @@ GDBRemoteCommunicationServerLLGS::LaunchProcess () error = NativeProcessProtocol::Launch( m_process_launch_info, *this, + m_mainloop, m_debugged_process_sp); } @@ -311,7 +298,7 @@ GDBRemoteCommunicationServerLLGS::AttachToProcess (lldb::pid_t pid) } // Try to attach. - error = NativeProcessProtocol::Attach(pid, *this, m_debugged_process_sp); + error = NativeProcessProtocol::Attach(pid, *this, m_mainloop, m_debugged_process_sp); if (!error.Success ()) { fprintf (stderr, "%s: failed to attach to process %" PRIu64 ": %s", __FUNCTION__, pid, error.AsCString ()); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 4ed30d5f991..11ee2d12a85 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -42,9 +42,6 @@ public: //------------------------------------------------------------------ GDBRemoteCommunicationServerLLGS(const lldb::PlatformSP& platform_sp, MainLoop &mainloop); - virtual - ~GDBRemoteCommunicationServerLLGS(); - //------------------------------------------------------------------ /// Specify the program to launch and its arguments. /// |