[Lldb-commits] [lldb] r235711 - Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream-record (MI)

Ilia K ki.stfu at gmail.com
Fri Apr 24 04:33:36 PDT 2015


Author: ki.stfu
Date: Fri Apr 24 06:33:36 2015
New Revision: 235711

URL: http://llvm.org/viewvc/llvm-project?rev=235711&view=rev
Log:
Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream-record (MI)


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

Modified: lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py?rev=235711&r1=235710&r2=235711&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py Fri Apr 24 06:33:36 2015
@@ -57,7 +57,7 @@ class MiGdbSetShowTestCase(lldbmi_testca
         # 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_testca
         # 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

Modified: lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py?rev=235711&r1=235710&r2=235711&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py (original)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py Fri Apr 24 06:33:36 2015
@@ -74,7 +74,7 @@ class MiCliSupportTestCase(lldbmi_testca
         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_testca
         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_testca
         # 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_testca
         # 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_testca
         # 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__':

Modified: lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=235711&r1=235710&r2=235711&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py Fri Apr 24 06:33:36 2015
@@ -72,7 +72,7 @@ class MiInterpreterExecTestCase(lldbmi_t
         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_t
         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_t
         # 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_t
         # 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_t
         # 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__':

Modified: lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py?rev=235711&r1=235710&r2=235711&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py (original)
+++ lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py Fri Apr 24 06:33:36 2015
@@ -75,7 +75,7 @@ class MiSyntaxTestCase(lldbmi_testcase.M
         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()

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=235711&r1=235710&r2=235711&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Fri Apr 24 06:33:36 2015
@@ -1534,8 +1534,9 @@ CMICmnLLDBDebuggerHandleEvents::GetProce
         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::GetProce
         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);
 }
 
 //++ ------------------------------------------------------------------------------------





More information about the lldb-commits mailing list