dawn created this revision.
dawn added reviewers: ted, zturner, clayborg.
dawn added subscribers: amccarth, lldb-commits.
dawn set the repository for this revision to rL LLVM.

The code added in svn trunk 264332 causes "(lldb)" to be printed in the middle 
of program console output.   This fix restores the behavior for non-Windows 
platforms to before the patch.

From a C++ program with the following source:

  ...
  printf("\n#Break: Function parameters - arrays");
  printf("\n#Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 #ExpectedEval:%d", 1001);
  printf("\n#Evaluate:FuncArr(C,B) #ExpectedEval:%d", RES);
  printf("\n#Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 + 0 #ExpectedEval:%d", 0);
  printf("\n#Evaluate:ref[0] + ref[1]*10 #ExpectedEval:%d", 65);
  printf("\n#Evaluate:FuncArrRet(7,8) #ExpectedLike:deferred");
  ...

produce the following output on iOS:

  #Break: Function parameters - arrays
  #Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 #ExpectedEval:1001
  #Evaluate:FuncArr(C,B) #ExpectedEval:4321
  #Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 + 0 #ExpectedEval:0
  #Evaluate:ref[0] + ref[1]*10 #ExpectedEval:65
  #Evalua(lldb) te:FuncArrRet(7,8) #ExpectedLike:deferred
  ...

Note the "(lldb) " inserted into the program output of the 6th print statement.


Repository:
  rL LLVM

https://reviews.llvm.org/D25137

Files:
  source/Core/IOHandler.cpp


Index: source/Core/IOHandler.cpp
===================================================================
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -590,8 +590,8 @@
   else
 #endif
   {
+#ifdef _MSC_VER
     const char *prompt = GetPrompt();
-#ifdef _MSC_VER
     if (prompt) {
       // Back up over previous prompt using Windows API
       CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
@@ -605,9 +605,11 @@
     }
 #endif
     IOHandler::PrintAsync(stream, s, len);
+#ifdef _MSC_VER
     if (prompt)
       IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt,
                             strlen(prompt));
+#endif
   }
 }
 


Index: source/Core/IOHandler.cpp
===================================================================
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -590,8 +590,8 @@
   else
 #endif
   {
+#ifdef _MSC_VER
     const char *prompt = GetPrompt();
-#ifdef _MSC_VER
     if (prompt) {
       // Back up over previous prompt using Windows API
       CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
@@ -605,9 +605,11 @@
     }
 #endif
     IOHandler::PrintAsync(stream, s, len);
+#ifdef _MSC_VER
     if (prompt)
       IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt,
                             strlen(prompt));
+#endif
   }
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to