[Lldb-commits] [lldb] r300636 - ifdefing out the signal handling code on Windows
Chris Bieneman via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 18 18:00:16 PDT 2017
Author: cbieneman
Date: Tue Apr 18 20:00:16 2017
New Revision: 300636
URL: http://llvm.org/viewvc/llvm-project?rev=300636&view=rev
Log:
ifdefing out the signal handling code on Windows
*fingers crossed*
This might fix the Window bots, but I really don't know...
Modified:
lldb/trunk/source/Host/common/MainLoop.cpp
Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300636&r1=300635&r2=300636&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 20:00:16 2017
@@ -32,7 +32,10 @@
#define POLL poll
#endif
-#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H
+#if SIGNAL_POLLING_UNSUPPORTED
+#ifdef LLVM_ON_WIN32
+typedef int sigset_t;
+#endif
int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts,
const sigset_t *) {
@@ -137,6 +140,10 @@ void MainLoop::UnregisterReadObject(IOOb
}
void MainLoop::UnregisterSignal(int signo) {
+#if SIGNAL_POLLING_UNSUPPORTED
+ error.SetErrorString("Signal polling is not supported on this platform.");
+ return nullptr;
+#else
// We undo the actions of RegisterSignal on a best-effort basis.
auto it = m_signals.find(signo);
assert(it != m_signals.end());
@@ -150,6 +157,7 @@ void MainLoop::UnregisterSignal(int sign
nullptr);
m_signals.erase(it);
+#endif
}
Error MainLoop::Run() {
@@ -198,9 +206,17 @@ Error MainLoop::Run() {
#else
read_fds.clear();
+
+#if !SIGNAL_POLLING_UNSUPPORTED
if (int ret = pthread_sigmask(SIG_SETMASK, nullptr, &sigmask))
return Error("pthread_sigmask failed with error %d\n", ret);
+ for (const auto &sig : m_signals) {
+ signals.push_back(sig.first);
+ sigdelset(&sigmask, sig.first);
+ }
+#endif
+
for (const auto &fd : m_read_fds) {
struct pollfd pfd;
pfd.fd = fd.first;
@@ -209,11 +225,6 @@ Error MainLoop::Run() {
read_fds.push_back(pfd);
}
- for (const auto &sig : m_signals) {
- signals.push_back(sig.first);
- sigdelset(&sigmask, sig.first);
- }
-
if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 &&
errno != EINTR)
return Error(errno, eErrorTypePOSIX);
More information about the lldb-commits
mailing list