[Lldb-commits] [PATCH] D48752: Quiet command regex instructions during batch execution

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Nov 3 00:42:04 PDT 2018


kastiglione updated this revision to Diff 172488.
kastiglione added a comment.

Added IOHandlerActivatedInteractively


https://reviews.llvm.org/D48752

Files:
  include/lldb/Core/IOHandler.h
  packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
  source/Commands/CommandObjectCommands.cpp
  source/Core/IOHandler.cpp


Index: source/Core/IOHandler.cpp
===================================================================
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -333,6 +333,8 @@
 void IOHandlerEditline::Activate() {
   IOHandler::Activate();
   m_delegate.IOHandlerActivated(*this);
+  if (GetIsInteractive())
+    m_delegate.IOHandlerActivatedInteractively(*this);
 }
 
 void IOHandlerEditline::Deactivate() {
Index: source/Commands/CommandObjectCommands.cpp
===================================================================
--- source/Commands/CommandObjectCommands.cpp
+++ source/Commands/CommandObjectCommands.cpp
@@ -980,10 +980,10 @@
   ~CommandObjectCommandsAddRegex() override = default;
 
 protected:
-  void IOHandlerActivated(IOHandler &io_handler) override {
+  void IOHandlerActivatedInteractively(IOHandler &io_handler) override {
     StreamFileSP output_sp(io_handler.GetOutputStreamFile());
     if (output_sp) {
-      output_sp->PutCString("Enter one of more sed substitution commands in "
+      output_sp->PutCString("Enter one or more sed substitution commands in "
                             "the form: 's/<regex>/<subst>/'.\nTerminate the "
                             "substitution list with an empty line.\n");
       output_sp->Flush();
Index: packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
+++ packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
@@ -24,7 +24,7 @@
         """Test a simple scenario of 'command regex' invocation and subsequent use."""
         import pexpect
         prompt = "(lldb) "
-        regex_prompt = "Enter one of more sed substitution commands in the form: 's/<regex>/<subst>/'.\r\nTerminate the substitution list with an empty line.\r\n"
+        regex_prompt = "Enter one or more sed substitution commands in the form: 's/<regex>/<subst>/'.\r\nTerminate the substitution list with an empty line.\r\n"
         regex_prompt1 = "\r\n"
 
         child = pexpect.spawn('%s %s' %
Index: include/lldb/Core/IOHandler.h
===================================================================
--- include/lldb/Core/IOHandler.h
+++ include/lldb/Core/IOHandler.h
@@ -200,6 +200,8 @@
 
   virtual void IOHandlerActivated(IOHandler &io_handler) {}
 
+  virtual void IOHandlerActivatedInteractively(IOHandler &io_handler) {}
+
   virtual void IOHandlerDeactivated(IOHandler &io_handler) {}
 
   virtual int IOHandlerComplete(IOHandler &io_handler, const char *current_line,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48752.172488.patch
Type: text/x-patch
Size: 2640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181103/ecb2f8f3/attachment.bin>


More information about the lldb-commits mailing list