gdb: Background Execution

 
 5.5.3 Background Execution
 --------------------------
 
 GDB's execution commands have two variants: the normal foreground
 (synchronous) behavior, and a background (asynchronous) behavior.  In
 foreground execution, GDB waits for the program to report that some
 thread has stopped before prompting for another command.  In background
 execution, GDB immediately gives a command prompt so that you can issue
 other commands while your program runs.
 
    If the target doesn't support async mode, GDB issues an error message
 if you attempt to use the background execution commands.
 
    To specify background execution, add a '&' to the command.  For
 example, the background form of the 'continue' command is 'continue&',
 or just 'c&'.  The execution commands that accept background execution
 are:
 
 'run'
      SeeStarting your Program Starting.
 
 'attach'
      SeeDebugging an Already-running Process Attach.
 
 'step'
      Seestep Continuing and Stepping.
 
 'stepi'
      Seestepi Continuing and Stepping.
 
 'next'
      Seenext Continuing and Stepping.
 
 'nexti'
      Seenexti Continuing and Stepping.
 
 'continue'
      Seecontinue Continuing and Stepping.
 
 'finish'
      Seefinish Continuing and Stepping.
 
 'until'
      Seeuntil Continuing and Stepping.
 
    Background execution is especially useful in conjunction with
 non-stop mode for debugging programs with multiple threads; see See
 Non-Stop Mode.  However, you can also use these commands in the normal
 all-stop mode with the restriction that you cannot issue another
 execution command until the previous one finishes.  Examples of commands
 that are valid in all-stop mode while the program is running include
 'help' and 'info break'.
 
    You can interrupt your program while it is running in the background
 by using the 'interrupt' command.
 
 'interrupt'
 'interrupt -a'
 
      Suspend execution of the running program.  In all-stop mode,
      'interrupt' stops the whole process, but in non-stop mode, it stops
      only the current thread.  To stop the whole program in non-stop
      mode, use 'interrupt -a'.