From f42f21746cb8b940518bf37e5917d61542d278b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 4 Apr 2022 10:36:54 +0200 Subject: [PATCH] [lldb][gui] handle Ctrl+C to stop a running process Differential Revision: https://reviews.llvm.org/D123015 --- lldb/include/lldb/Interpreter/CommandInterpreter.h | 4 ++-- lldb/source/Core/IOHandlerCursesGUI.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index 641e651..f1f715c 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -610,6 +610,8 @@ public: bool IsInteractive(); + bool IOHandlerInterrupt(IOHandler &io_handler) override; + protected: friend class Debugger; @@ -623,8 +625,6 @@ protected: return ConstString(); } - bool IOHandlerInterrupt(IOHandler &io_handler) override; - void GetProcessOutput(); bool DidProcessStopAbnormally() const; diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp index caf88c7..c8d86f0 100644 --- a/lldb/source/Core/IOHandlerCursesGUI.cpp +++ b/lldb/source/Core/IOHandlerCursesGUI.cpp @@ -7710,7 +7710,9 @@ IOHandlerCursesGUI::~IOHandlerCursesGUI() = default; void IOHandlerCursesGUI::Cancel() {} -bool IOHandlerCursesGUI::Interrupt() { return false; } +bool IOHandlerCursesGUI::Interrupt() { + return m_debugger.GetCommandInterpreter().IOHandlerInterrupt(*this); +} void IOHandlerCursesGUI::GotEOF() {} -- 2.7.4