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,


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,
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to