title: How can I reach STDIN/STDOUT through a gdbserver session
body: <p>If I start a normal 'gdb' session, then I can reach <code>STDIN</code> and see <code>STDOUT</code> directly in the terminal:</p>
  
  <pre><code>$ gdb wc
  GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
  ...
  gdb&gt; run
  Starting program: /usr/bin/wc 
  asdf
        1       1       5
  [Inferior 1 (process 28131) exited normally]
  gdb&gt; quit
  $ 
  </code></pre>
  
  <p>Can I do the same with a gdbserver???</p>
  
  <p>Here is what I have tried (gdbserver):</p>
  
  <pre><code>$ gdbserver /dev/ttyS0 wc
  Process wc created; pid = 28156
  Listening on port 2345
  </code></pre>
  
  <p>and client:</p>
  
  <pre><code>$ gdb
  GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
  ...
  gdb&gt; c
  Continuing.
  
  Program received signal SIGINT, Interrupt.
  0x00007ffff7ddbc40 in _start () from target:/lib64/ld-linux-x86-64.so.2
  gdb&gt;
  </code></pre>
  
  <p>But, it seems like <code>STDIN</code>/<code>STDOUT</code> is not being connected when using the gdbserver.</p>
  
  <p><strong>How can I run remote debugging over the serial line, and also access <code>STDIN</code>/<code>STDOUT</code> of the application that I'm debugging over the same serial line??</strong></p>