summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-09-16 23:12:18 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-09-16 23:12:18 +0000
commit1efb418c9dc8315db607b852e601e2043ec58759 (patch)
treeff7e6e543ad8fc34e2120903c8214ec4f37c2a3e /lldb/source/Plugins/Process/Linux/ProcessMonitor.h
parent7baa983a7e07f869b24d38836ad79a5877905af8 (diff)
downloadbcm5719-llvm-1efb418c9dc8315db607b852e601e2043ec58759.tar.gz
bcm5719-llvm-1efb418c9dc8315db607b852e601e2043ec58759.zip
Improve stability of Linux ProcessMonitor by not using fds for synchronization:
- ProcessMonitor::[Do|Serve]Operation no longer depend on file descriptors! - removed unused member functions CloseFD and EnableIPC - add semaphores to signal when an Operation is ready to be processed/complete. This commit fixes a bug that was identified under stress-testing (i.e. build LLVM while running tests) that led to LLDB becoming unresponsive because the read/write operations on file descriptors in ProcessMonitor were not checked. Other test runner improvement/convenience: - pickup environment variables LLDB_LINUX_LOG and LLDB_LINUX_LOG_OPTIONS to enable (Linux) logging when running the test suite. Example usage: $ LLDB_LINUX_LOG="mylog.txt" LLDB_LINUX_LOG_OPTIONS="process thread" python dotest.py llvm-svn: 190820
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/ProcessMonitor.h')
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
index 2de6bc0737d..4d02e61a10f 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
@@ -193,10 +193,15 @@ private:
lldb::pid_t m_pid;
int m_terminal_fd;
+ // current operation which must be executed on the priviliged thread
+ Operation *m_operation;
+ lldb_private::Mutex m_operation_mutex;
+
+ // semaphores notified when Operation is ready to be processed and when
+ // the operation is complete.
+ sem_t m_operation_pending;
+ sem_t m_operation_done;
- lldb_private::Mutex m_server_mutex;
- int m_client_fd;
- int m_server_fd;
struct OperationArgs
{
@@ -244,9 +249,6 @@ private:
static bool
Launch(LaunchArgs *args);
- bool
- EnableIPC();
-
struct AttachArgs : OperationArgs
{
AttachArgs(ProcessMonitor *monitor,
@@ -309,9 +311,6 @@ private:
/// Stops the operation thread used to attach/launch a process.
void
StopOpThread();
-
- void
- CloseFD(int &fd);
};
#endif // #ifndef liblldb_ProcessMonitor_H_
OpenPOWER on IntegriCloud