Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream...
authorIlia K <ki.stfu@gmail.com>
Fri, 24 Apr 2015 11:33:36 +0000 (11:33 +0000)
committerIlia K <ki.stfu@gmail.com>
Fri, 24 Apr 2015 11:33:36 +0000 (11:33 +0000)
llvm-svn: 235711

lldb/test/tools/lldb-mi/TestMiGdbSetShow.py
lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py
lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp

index f2e7e78..c683300 100644 (file)
@@ -57,7 +57,7 @@ class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that program is executed in async mode
         self.runCmd("-exec-run")
         self.expect("\*running")
-        self.expect("~\"argc=1")
+        self.expect("@\"argc=1")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -80,9 +80,9 @@ class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that program is executed in async mode
         self.runCmd("-exec-run")
         unexpected = [ "\*running" ] # "\*running" is async notification
-        it = self.expect(unexpected + [ "~\"argc=1\\\\r\\\\n" ])
+        it = self.expect(unexpected + [ "@\"argc=1\\\\r\\\\n" ])
         if it < len(unexpected):
-            # generate error if it's not "~\"argc=1\\\\r\\\\n"
+            # generate error if it's not "@\"argc=1\\\\r\\\\n"
             self.expect("$UNEXPECTED FOUND: %s\.^" % unexpected[it], timeout = 0)
 
     @lldbmi_test
index 896b4ff..9a1a155 100644 (file)
@@ -74,7 +74,7 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
         self.expect("\^running")
 
         # Test that arguments were passed properly
-        self.expect("~\"argc=5\\\\r\\\\n\"")
+        self.expect("@\"argc=5\\\\r\\\\n\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -99,7 +99,7 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
         self.expect("\^running")
 
         # Test that arguments were passed properly
-        self.expect("~\"argc=5\\\\r\\\\n\"")
+        self.expect("@\"argc=5\\\\r\\\\n\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -151,7 +151,7 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
         # Linux:  "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\"
         self.runCmd("thread step-in")
         self.expect("\^done")
-        it = self.expect([ "~\"argc=1\\\\r\\\\n\"",
+        it = self.expect([ "@\"argc=1\\\\r\\\\n\"",
                            "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ])
         if it == 0:
             self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
@@ -179,7 +179,7 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that "thread step-over" steps over
         self.runCmd("thread step-over")
         self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n\"")
+        self.expect("@\"argc=1\\\\r\\\\n\"")
         self.expect("\*stopped,reason=\"end-stepping-range\"")
 
     @lldbmi_test
@@ -205,7 +205,7 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that "thread continue" continues execution
         self.runCmd("thread continue")
         self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n")
+        self.expect("@\"argc=1\\\\r\\\\n")
         self.expect("\*stopped,reason=\"exited-normally\"")
 
 if __name__ == '__main__':
index 9157a17..6ec2ea2 100644 (file)
@@ -72,7 +72,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
         self.expect("\^running")
 
         # Test that arguments were passed properly
-        self.expect("~\"argc=2\\\\r\\\\n\"")
+        self.expect("@\"argc=2\\\\r\\\\n\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -96,7 +96,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
         self.expect("\^running")
 
         # Test that arguments were passed properly
-        self.expect("~\"argc=2\\\\r\\\\n\"")
+        self.expect("@\"argc=2\\\\r\\\\n\"")
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@@ -146,7 +146,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
         # Linux:  "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\"
         self.runCmd("-interpreter-exec console \"thread step-in\"")
         self.expect("\^done")
-        it = self.expect([ "~\"argc=1\\\\r\\\\n\"",
+        it = self.expect([ "@\"argc=1\\\\r\\\\n\"",
                            "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ])
         if it == 0:
             self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
@@ -173,7 +173,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that "thread step-over" steps over
         self.runCmd("-interpreter-exec console \"thread step-over\"")
         self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n\"")
+        self.expect("@\"argc=1\\\\r\\\\n\"")
         self.expect("\*stopped,reason=\"end-stepping-range\"")
 
     @lldbmi_test
@@ -198,7 +198,7 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
         # Test that "thread continue" continues execution
         self.runCmd("-interpreter-exec console \"thread continue\"")
         self.expect("\^done")
-        self.expect("~\"argc=1\\\\r\\\\n")
+        self.expect("@\"argc=1\\\\r\\\\n")
         self.expect("\*stopped,reason=\"exited-normally\"")
 
 if __name__ == '__main__':
index d1e5cf5..1bcd79f 100644 (file)
@@ -75,7 +75,7 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
         self.expect("\^running")
 
         # Test that a process output is wrapped correctly
-        self.expect("\~\"'\\\\r\\\\n` - it's \\\\\\\\n\\\\x12\\\\\"\\\\\\\\\\\\\"")
+        self.expect("\@\"'\\\\r\\\\n` - it's \\\\\\\\n\\\\x12\\\\\"\\\\\\\\\\\\\"")
 
 if __name__ == '__main__':
     unittest2.main()
index c99aa5d..cc30e0a 100644 (file)
@@ -1534,8 +1534,9 @@ CMICmnLLDBDebuggerHandleEvents::GetProcessStdout(void)
         return MIstatus::success;
 
     const bool bEscapeQuotes(true);
-    const CMIUtilString t(CMIUtilString::Format("~\"%s\"", text.Escape(bEscapeQuotes).c_str()));
-    return TextToStdout(t);
+    CMICmnMIValueConst miValueConst(text.Escape(bEscapeQuotes));
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput, miValueConst);
+    return MiOutOfBandRecordToStdout(miOutOfBandRecord);
 }
 
 //++ ------------------------------------------------------------------------------------
@@ -1567,8 +1568,9 @@ CMICmnLLDBDebuggerHandleEvents::GetProcessStderr(void)
         return MIstatus::success;
 
     const bool bEscapeQuotes(true);
-    const CMIUtilString t(CMIUtilString::Format("~\"%s\"", text.Escape(bEscapeQuotes).c_str()));
-    return TextToStdout(t);
+    CMICmnMIValueConst miValueConst(text.Escape(bEscapeQuotes));
+    CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput, miValueConst);
+    return MiOutOfBandRecordToStdout(miOutOfBandRecord);
 }
 
 //++ ------------------------------------------------------------------------------------