<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 --- - Setting up stdio redirection does not work if inferior started in synchronous mode (-o run)"
   href="https://llvm.org/bugs/show_bug.cgi?id=23371">23371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Setting up stdio redirection does not work if inferior started in synchronous mode (-o run)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>labath@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I think the example says it all:

$ cat a.c
#include <stdio.h>

int main()
{
    int i;
    printf("enter a number: ");
    scanf("%d", &i);
    printf("got %d\n", i);
    return 0;
}
$ gcc a.c
$ lldb a.out -o run
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) run
enter a number: 47
42
...
^CProcess 6656 stopped
* thread #1: tid = 6656, 0x00007ffff7b00810 libc.so.6`__GI___read + 16, name =
'a.out', stop reason = signal SIGSTOP
    frame #0: 0x00007ffff7b00810 libc.so.6`__GI___read + 16
libc.so.6`__GI___read:
->  0x7ffff7b00810 <+16>: cmpq   $-0xfff, %rax
    0x7ffff7b00816 <+22>: jae    0x7ffff7b00849            ; <+73>
    0x7ffff7b00818 <+24>: retq   

libc.so.6`???:
    0x7ffff7b00819 <+25>: subq   $0x8, %rsp

Process 6656 launched: '/usr/local/google/home/labath/ll/build/dbg/a.out'
(x86_64)</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>