[llvm-branch-commits] [lldb] r198964 - Fix a multi-line failure exposed by TestCommandRegex.py

Todd Fiala tfiala at google.com
Fri Jan 10 14:40:27 PST 2014

Author: tfiala
Date: Fri Jan 10 16:40:27 2014
New Revision: 198964

URL: http://llvm.org/viewvc/llvm-project?rev=198964&view=rev
Fix a multi-line failure exposed by TestCommandRegex.py

When using libedit, the multi-line input handler is stripping one too
many lines from the collected input. This is causing 'command regex'
and its related test to fail.

This change also fixes an issue in the test itself, where the test was
expecting different output than the command currently emits.

Patch by Steve Pucci and Todd Fiala


Modified: lldb/branches/iohandler/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/source/Commands/CommandObjectCommands.cpp?rev=198964&r1=198963&r2=198964&view=diff
--- lldb/branches/iohandler/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/branches/iohandler/source/Commands/CommandObjectCommands.cpp Fri Jan 10 16:40:27 2014
@@ -956,10 +956,9 @@ protected:
         if (line_idx == UINT32_MAX)
-            // Remove the last "DONE" line from "lines" so it doesn't appear
-            // in our final commands and return true to indicate we are done
-            // getting lines
-            lines.PopBack();
+            // Return true to indicate we are done getting lines (this
+            // is a "fake" line - the real terminating blank line was
+            // removed during a previous call with the code below)
             return LineStatus::Done;

Modified: lldb/branches/iohandler/test/functionalities/command_regex/TestCommandRegex.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/test/functionalities/command_regex/TestCommandRegex.py?rev=198964&r1=198963&r2=198964&view=diff
--- lldb/branches/iohandler/test/functionalities/command_regex/TestCommandRegex.py (original)
+++ lldb/branches/iohandler/test/functionalities/command_regex/TestCommandRegex.py Fri Jan 10 16:40:27 2014
@@ -13,9 +13,9 @@ class CommandRegexTestCase(TestBase):
     mydir = TestBase.compute_mydir(__file__)
     def test_command_regex(self):
-        """Test a simple scenario of 'command regexp' invocation and subsequent use."""
+        """Test a simple scenario of 'command regex' invocation and subsequent use."""
         prompt = "(lldb) "
-        regex_prompt = "Enter regular expressions in the form 's/<regex>/<subst>/' and terminate with an empty line:\r\n"
+        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_prompt1 = "\r\n"
         child = pexpect.spawn('%s %s' % (self.lldbHere, self.lldbOption))

More information about the llvm-branch-commits mailing list