title: GDB: recover control from blocked process
body: <p>I have the following problem: I want to recover control of gdb when a process enters a blocking situation i.e. a blocking function or a pooling loop.</p>
  
  <p>Lets illustrate it with an example: I have process A which forks process B. B does its work and then gets stuck waiting for an event from A. I want to switch GDB to A so I can run it separately until the event generation. However, I can not recover control of GDB from B. Of course I can ctrl+C in B which generates a SIGINT signal, and then change to A, but when I go back to B, even if I handle pass SIGINT, B finishes.</p>
  
  <pre><code>Log:
  Program received signal SIGINT, Interrupt.
  [Switching to Thread 0xb68feb40 (LWP 3177)]
  0xb7fdeb0c in ?? ()
  (gdb) handle SIGINT pass
  SIGINT is used by the debugger.
  Are you sure you want to change it? (y or n) y
  Signal        Stop  Print   Pass to program Description
  SIGINT        Yes   Yes Yes     Interrupt
  (gdb) c
  Continuing.
  [Thread 0xb7abcb40 (LWP 3178) exited]
  [Thread 0xb68feb40 (LWP 3177) exited]
  Couldn't get registers: No such process.
  
  (gdb) info inferiors    
  Num  Description       
  * 2    &lt;null&gt;           
  1    process 3168      
  </code></pre>
  
  <p>Is there a way to recover control of GDB and switch process without killing it?</p>