summaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MIDriverMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lldb-mi/MIDriverMain.cpp')
-rw-r--r--tools/lldb-mi/MIDriverMain.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/lldb-mi/MIDriverMain.cpp b/tools/lldb-mi/MIDriverMain.cpp
index b14fb815b6e6a..5557799d3680b 100644
--- a/tools/lldb-mi/MIDriverMain.cpp
+++ b/tools/lldb-mi/MIDriverMain.cpp
@@ -49,7 +49,7 @@
// Third party headers:
#include <stdio.h>
-#include <lldb/API/SBHostOS.h>
+#include "lldb/API/SBHostOS.h"
// In house headers:
#include "MICmnConfig.h"
@@ -81,6 +81,9 @@
void
sigwinch_handler(int vSigno)
{
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+ signal(SIGWINCH, sigwinch_handler);
+#endif
MIunused(vSigno);
struct winsize window_size;
@@ -111,6 +114,9 @@ sigwinch_handler(int vSigno)
void
sigint_handler(int vSigno)
{
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+ signal(SIGINT, sigint_handler);
+#endif
static bool g_interrupt_sent = false;
CMIDriverMgr &rDriverMgr = CMIDriverMgr::Instance();
lldb::SBDebugger *pDebugger = rDriverMgr.DriverGetTheDebugger();
@@ -147,6 +153,9 @@ sigint_handler(int vSigno)
void
sigtstp_handler(int vSigno)
{
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+ signal(SIGTSTP, sigtstp_handler);
+#endif
CMIDriverMgr &rDriverMgr = CMIDriverMgr::Instance();
lldb::SBDebugger *pDebugger = rDriverMgr.DriverGetTheDebugger();
if (pDebugger != nullptr)
@@ -175,6 +184,9 @@ sigtstp_handler(int vSigno)
void
sigcont_handler(int vSigno)
{
+#ifdef _WIN32 // Restore handler as it is not persistent on Windows
+ signal(SIGCONT, sigcont_handler);
+#endif
CMIDriverMgr &rDriverMgr = CMIDriverMgr::Instance();
lldb::SBDebugger *pDebugger = rDriverMgr.DriverGetTheDebugger();
if (pDebugger != nullptr)