Previous: Interrupted System Calls, Up: Thread Stops
If you want to build on non-stop mode and observe program behavior without any chance of disruption by gdb, you can set variables to disable all of the debugger's attempts to modify state, whether by writing memory, inserting breakpoints, etc. These operate at a low level, intercepting operations from all commands.
When all of these are set to off, then gdb is said to
be observer mode.  As a convenience, the variable
observer can be set to disable these, plus enable non-stop
mode.
   
Note that gdb will not prevent you from making nonsensical
combinations of these settings. For instance, if you have enabled
may-insert-breakpoints but disabled may-write-memory,
then breakpoints that work by writing trap instructions into the code
stream will still not be able to be placed.
     
set observer onset observer offon, this disables all the permission variables
below (except for insert-fast-tracepoints), plus enables
non-stop debugging.  Setting this to off switches back to
normal debugging, though remaining in non-stop mode.
     show observerset may-write-registers onset may-write-registers offprint, or the
jump command.  It defaults to on.
     show may-write-registersset may-write-memory onset may-write-memory offprint.  It
defaults to on.
     show may-write-memoryset may-insert-breakpoints onset may-insert-breakpoints offon.
     show may-insert-breakpointsset may-insert-tracepoints onset may-insert-tracepoints offmay-insert-fast-tracepoints.  It defaults to on.
     show may-insert-tracepointsset may-insert-fast-tracepoints onset may-insert-fast-tracepoints offmay-insert-tracepoints.  It defaults to on.
     show may-insert-fast-tracepointsset may-interrupt onset may-interrupt offoff, the
interrupt command will have no effect, nor will
Ctrl-c. It defaults to on.
     show may-interrupt