[Lldb-commits] [lldb] r365868 - [windows] re-call signal in sigint_handler for Windows

Nathan Lanza via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 11 21:43:46 PDT 2019

Author: lanza
Date: Thu Jul 11 21:43:46 2019
New Revision: 365868

URL: http://llvm.org/viewvc/llvm-project?rev=365868&view=rev
[windows] re-call signal in sigint_handler for Windows

Windows requires re-setting the signal handler each time it is used
and thus ctrl-c was not behaving properly on Windows

Reviewers: jfb

Differential Revision: https://reviews.llvm.org/D64046


Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=365868&r1=365867&r2=365868&view=diff
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Thu Jul 11 21:43:46 2019
@@ -706,6 +706,9 @@ void sigwinch_handler(int signo) {
 void sigint_handler(int signo) {
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+  signal(SIGINT, sigint_handler);
   static std::atomic_flag g_interrupt_sent = ATOMIC_FLAG_INIT;
   if (g_driver != nullptr) {
     if (!g_interrupt_sent.test_and_set()) {

More information about the lldb-commits mailing list