aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-07-15 17:20:01 +0000
committerPavel Labath <labath@google.com>2015-07-15 17:20:01 +0000
commit827965c33c5aae9440c4744e0c65a43db3f18cd6 (patch)
treebfb66bffdae3477b9a622be42b5d67883f262120 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
parent2e668b2d11177e3f83147133ad4d6512a00f97aa (diff)
downloadllvm-827965c33c5aae9440c4744e0c65a43db3f18cd6.zip
llvm-827965c33c5aae9440c4744e0c65a43db3f18cd6.tar.gz
llvm-827965c33c5aae9440c4744e0c65a43db3f18cd6.tar.bz2
[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 llvm-svn: 242305
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index c452325..c00ea92 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -96,20 +96,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()
{
@@ -223,6 +209,7 @@ GDBRemoteCommunicationServerLLGS::LaunchProcess ()
error = NativeProcessProtocol::Launch(
m_process_launch_info,
*this,
+ m_mainloop,
m_debugged_process_sp);
}
@@ -308,7 +295,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 ());