title: gdb break after input
body: <p>i'm trying to learn gdb. i wrote a simple program that just listen to input via fgets and compare it to a 'password'.</p>
  
  <p>how can i use gdb to halt the program and see the comparisson?</p>
  
  <p>if i halt execution with <code>ctrl+c</code> during the input i get:</p>
  
  <pre><code>   #7  0xf7e771ea in _IO_fgets (buf=0xffffd7f0 "T\332\377", &lt;incomplete sequence \367&gt;, n=256, fp=0xf7fa9440) at iofgets.c:58
     #8  0x080486bc in check_password ()
     #9  0x08048949 in main ()
  </code></pre>
  
  <p>Is there any way i can show the code listing of <code>check_password</code>? if i trype <code>list</code> it shows me fgets'...</p>
  
  <p>any way i can step out of <code>fgets</code>?</p>
  
  <p>what would you do from here?</p>