Fixup Windows build breaks for the llgs upstream.

Also moves NativeRegisterContextLinux* files into the Linux directory.
These, like NativeProcessLinux, should only be built on Linux or a cross
compiler with proper headers.

llvm-svn: 212074
diff --git a/lldb/source/Plugins/Process/Linux/CMakeLists.txt b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
index 3f15e19..4753219 100644
--- a/lldb/source/Plugins/Process/Linux/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
@@ -6,6 +6,7 @@
 
 add_lldb_library(lldbPluginProcessLinux
   NativeProcessLinux.cpp
+  NativeRegisterContextLinux_x86_64.cpp
   NativeThreadLinux.cpp
   ProcessLinux.cpp
   ProcessMonitor.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.cpp
rename to lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h
rename to lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index d9cd183..d5f2753 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -12,12 +12,13 @@
 #include <signal.h>
 
 #include "NativeProcessLinux.h"
+#include "NativeRegisterContextLinux_x86_64.h"
+
 #include "lldb/Core/Log.h"
 #include "lldb/Core/State.h"
 #include "lldb/Host/Host.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-private-log.h"
-#include "Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
 #include "Plugins/Process/Utility/RegisterInfoInterface.h"
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 880b875..31055297 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -9,7 +9,6 @@
   HistoryUnwind.cpp
   InferiorCallPOSIX.cpp
   LinuxSignals.cpp
-  NativeRegisterContextLinux_x86_64.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
   RegisterContextDarwin_i386.cpp
diff --git a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
index f0affb7..fb49df6 100644
--- a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
+++ b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// C Includes
-#include <signal.h>
-
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
@@ -28,52 +25,38 @@
 {
     m_signals.clear();
 
-    // FIXME we now need *Signals classes on systems that are different OSes (e.g. LinuxSignals
-    // needed on MacOSX to debug Linux from MacOSX, and similar scenarios, used by ProcessGDBRemote).  These must be defined
-    // not based on OS includes and defines.
-
-#define ADDSIGNAL(S, SUPPRESS, STOP, NOTIFY, DESCRIPTION) \
-    AddSignal(SIG ## S, "SIG" #S, #S, SUPPRESS, STOP, NOTIFY, DESCRIPTION)
-
-    ADDSIGNAL(HUP,    false,  true,  true, "hangup");
-    ADDSIGNAL(INT,    true,   true,  true, "interrupt");
-    ADDSIGNAL(QUIT,   false,  true,  true, "quit");
-    ADDSIGNAL(ILL,    false,  true,  true, "illegal instruction");
-    ADDSIGNAL(TRAP,   true,   true,  true, "trace trap (not reset when caught)");
-    ADDSIGNAL(ABRT,   false,  true,  true, "abort");
-    ADDSIGNAL(IOT,    false,  true,  true, "abort");
-    ADDSIGNAL(BUS,    false,  true,  true, "bus error");
-    ADDSIGNAL(FPE,    false,  true,  true, "floating point exception");
-    ADDSIGNAL(KILL,   false,  true,  true, "kill");
-    ADDSIGNAL(USR1,   false,  true,  true, "user defined signal 1");
-    ADDSIGNAL(SEGV,   false,  true,  true, "segmentation violation");
-    ADDSIGNAL(USR2,   false,  true,  true, "user defined signal 2");
-    ADDSIGNAL(PIPE,   false,  true,  true, "write to pipe with reading end closed");
-    ADDSIGNAL(ALRM,   false,  false, true, "alarm");
-    ADDSIGNAL(TERM,   false,  true,  true, "termination requested");
-#ifdef SIGSTKFLT
-    ADDSIGNAL(STKFLT, false,  true,  true, "stack fault");
-#endif
-    ADDSIGNAL(CHLD,   false,  false, true, "child process exit");
-    ADDSIGNAL(CONT,   false,  true,  true, "process continue");
-    ADDSIGNAL(STOP,   true,   true,  true, "process stop");
-    ADDSIGNAL(TSTP,   false,  true,  true, "tty stop");
-    ADDSIGNAL(TTIN,   false,  true,  true, "background tty read");
-    ADDSIGNAL(TTOU,   false,  true,  true, "background tty write");
-    ADDSIGNAL(URG,    false,  true,  true, "urgent data on socket");
-    ADDSIGNAL(XCPU,   false,  true,  true, "CPU resource exceeded");
-    ADDSIGNAL(XFSZ,   false,  true,  true, "file size limit exceeded");
-    ADDSIGNAL(VTALRM, false,  true,  true, "virtual alarm");
-    ADDSIGNAL(PROF,   false,  true,  true, "profiling alarm");
-    ADDSIGNAL(WINCH,  false,  true,  true, "window size change");
-#ifdef SIGPOLL
-    ADDSIGNAL(POLL,   false,  true,  true, "pollable event");
-#endif
-    ADDSIGNAL(IO,     false,  true,  true, "input/output ready");
-#ifdef SIGPWR
-    ADDSIGNAL(PWR,    false,  true,  true, "power failure");
-#endif
-    ADDSIGNAL(SYS,    false,  true,  true, "invalid system call");
-
-#undef ADDSIGNAL
+    AddSignal (1,    "SIGHUP",    "HUP",     false,   true , true , "hangup");
+    AddSignal (2,    "SIGINT",    "INT",     true ,   true , true , "interrupt");
+    AddSignal (3,    "SIGQUIT",   "QUIT",    false,   true , true , "quit");
+    AddSignal (4,    "SIGILL",    "ILL",     false,   true , true , "illegal instruction");
+    AddSignal (5,    "SIGTRAP",   "TRAP",    true ,   true , true , "trace trap (not reset when caught)");
+    AddSignal (6,    "SIGABRT",   "ABRT",    false,   true , true , "abort()");
+    AddSignal (6,    "SIGIOT",    "IOT",     false,   true , true , "IOT trap");
+    AddSignal (7,    "SIGBUS",    "BUS",     false,   true , true , "bus error");
+    AddSignal (8,    "SIGFPE",    "FPE",     false,   true , true , "floating point exception");
+    AddSignal (9,    "SIGKILL",   "KILL",    false,   true , true , "kill");
+    AddSignal (10,   "SIGUSR1",   "USR1",    false,   true , true , "user defined signal 1");
+    AddSignal (11,   "SIGSEGV",   "SEGV",    false,   true , true , "segmentation violation");
+    AddSignal (12,   "SIGUSR2",   "USR2",    false,   true , true , "user defined signal 2");
+    AddSignal (13,   "SIGPIPE",   "PIPE",    false,   true , true , "write to pipe with reading end closed");
+    AddSignal (14,   "SIGALRM",   "ALRM",    false,   false, false, "alarm");
+    AddSignal (15,   "SIGTERM",   "TERM",    false,   true , true , "termination requested");
+    AddSignal (16,   "SIGSTKFLT", "STKFLT",  false,   true , true , "stack fault");
+    AddSignal (16,   "SIGCLD",    "CLD",     false,   false, true , "same as SIGCHLD");
+    AddSignal (17,   "SIGCHLD",   "CHLD",    false,   false, true , "child status has changed");
+    AddSignal (18,   "SIGCONT",   "CONT",    false,   true , true , "process continue");
+    AddSignal (19,   "SIGSTOP",   "STOP",    true ,   true , true , "process stop");
+    AddSignal (20,   "SIGTSTP",   "TSTP",    false,   true , true , "tty stop");
+    AddSignal (21,   "SIGTTIN",   "TTIN",    false,   true , true , "background tty read");
+    AddSignal (22,   "SIGTTOU",   "TTOU",    false,   true , true , "background tty write");
+    AddSignal (23,   "SIGURG",    "URG",     false,   true , true , "urgent data on socket");
+    AddSignal (24,   "SIGXCPU",   "XCPU",    false,   true , true , "CPU resource exceeded");
+    AddSignal (25,   "SIGXFSZ",   "XFSZ",    false,   true , true , "file size limit exceeded");
+    AddSignal (26,   "SIGVTALRM", "VTALRM",  false,   true , true , "virtual time alarm");
+    AddSignal (27,   "SIGPROF",   "PROF",    false,   true , true , "profiling time alarm");
+    AddSignal (28,   "SIGWINCH",  "WINCH",   false,   true , true , "window size changes");
+    AddSignal (29,   "SIGPOLL",   "POLL",    false,   true , true , "pollable event");
+    AddSignal (29,   "SIGIO",     "IO",      false,   true , true , "input/output ready");
+    AddSignal (30,   "SIGPWR",    "PWR",     false,   true , true , "power failure");
+    AddSignal (31,   "SIGSYS",    "SYS",     false,   true , true , "invalid system call");
 }
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 3d19b11..e59cf34 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -15,6 +15,8 @@
 // C Includes
 // C++ Includes
 #include <cstring>
+#include <chrono>
+#include <thread>
 
 // Other libraries and framework includes
 #include "llvm/ADT/Triple.h"
@@ -535,8 +537,8 @@
             if (log)
                 log->Printf ("GDBRemoteCommunicationServer::%s waiting for launched process to hit first stop (%d)...", __FUNCTION__, iteration++);
 
-            // FIXME use a sleep method with finer granularity.
-            sleep (1);
+            // FIXME use a finer granularity.
+            std::this_thread::sleep_for(std::chrono::seconds(1));
         }
 
         if (log)