<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Data from SBProcess::PutSTDIN appears in SBProcess::GetSTDOUT"
   href="https://llvm.org/bugs/show_bug.cgi?id=24976">24976</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Data from SBProcess::PutSTDIN appears in SBProcess::GetSTDOUT
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>berykubik@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14953" name="attach_14953" title="Python script with PutSTDIN and GetSTDOUT test">attachment 14953</a> <a href="attachment.cgi?id=14953&action=edit" title="Python script with PutSTDIN and GetSTDOUT test">[details]</a></span>
Python script with PutSTDIN and GetSTDOUT test

When I use the function SBProcess::PutSTDIN to put data into process' STDIN,
the entered data then appears when I get the process' STDOUT.

I attached C++ test program which reads a string (x) and then outputs "stdout:
<x>" and a python script that shows that the stdout contains both "stdout: <x>"
and x. The sleep is there to wait for the program to output data.

// C++ program:
#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
    string a;
    cin >> a;
    cout << "stdout: " << a << endl;

    return 0;
}

After I run this program with input "test", it should output "stdout: test".
But when I put "test" to the process via PutSTDIN, the GetSTDOUT contains both
"test" and "stdout: test".

Am I doing something wrong?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>