[Lldb-commits] [PATCH] D123015: handle Ctrl+C to stop a running process

Luboš Luňák via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 4 01:39:55 PDT 2022


llunak created this revision.
llunak added a reviewer: clayborg.
llunak added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
llunak requested review of this revision.
Herald added a subscriber: lldb-commits.

This is essentially the same as IOHandlerEditline::Interrupt(), minus the editline stuff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123015

Files:
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/source/Core/IOHandlerCursesGUI.cpp


Index: lldb/source/Core/IOHandlerCursesGUI.cpp
===================================================================
--- lldb/source/Core/IOHandlerCursesGUI.cpp
+++ lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -7715,7 +7715,9 @@
 
 void IOHandlerCursesGUI::Cancel() {}
 
-bool IOHandlerCursesGUI::Interrupt() { return false; }
+bool IOHandlerCursesGUI::Interrupt() {
+  return m_debugger.GetCommandInterpreter().IOHandlerInterrupt(*this);
+}
 
 void IOHandlerCursesGUI::GotEOF() {}
 
Index: lldb/include/lldb/Interpreter/CommandInterpreter.h
===================================================================
--- lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -610,6 +610,8 @@
 
   bool IsInteractive();
 
+  bool IOHandlerInterrupt(IOHandler &io_handler) override;
+
 protected:
   friend class Debugger;
 
@@ -623,8 +625,6 @@
     return ConstString();
   }
 
-  bool IOHandlerInterrupt(IOHandler &io_handler) override;
-
   void GetProcessOutput();
 
   bool DidProcessStopAbnormally() const;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123015.420120.patch
Type: text/x-patch
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220404/10f4e47f/attachment.bin>


More information about the lldb-commits mailing list