Previous: Interrupted System Calls, Up: Thread Stops [Contents][Index]
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 on
set observer off
When set to on
, 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 observer
Show whether observer mode is on or off.
set may-write-registers on
set may-write-registers off
This controls whether GDB will attempt to alter the values of
registers, such as with assignment expressions in print
, or the
jump
command. It defaults to on
.
show may-write-registers
Show the current permission to write registers.
set may-write-memory on
set may-write-memory off
This controls whether GDB will attempt to alter the contents
of memory, such as with assignment expressions in print
. It
defaults to on
.
show may-write-memory
Show the current permission to write memory.
set may-insert-breakpoints on
set may-insert-breakpoints off
This controls whether GDB will attempt to insert breakpoints.
This affects all breakpoints, including internal breakpoints defined
by GDB. It defaults to on
.
show may-insert-breakpoints
Show the current permission to insert breakpoints.
set may-insert-tracepoints on
set may-insert-tracepoints off
This controls whether GDB will attempt to insert (regular)
tracepoints at the beginning of a tracing experiment. It affects only
non-fast tracepoints, fast tracepoints being under the control of
may-insert-fast-tracepoints
. It defaults to on
.
show may-insert-tracepoints
Show the current permission to insert tracepoints.
set may-insert-fast-tracepoints on
set may-insert-fast-tracepoints off
This controls whether GDB will attempt to insert fast
tracepoints at the beginning of a tracing experiment. It affects only
fast tracepoints, regular (non-fast) tracepoints being under the
control of may-insert-tracepoints
. It defaults to on
.
show may-insert-fast-tracepoints
Show the current permission to insert fast tracepoints.
set may-interrupt on
set may-interrupt off
This controls whether GDB will attempt to interrupt or stop
program execution. When this variable is off
, the
interrupt
command will have no effect, nor will
Ctrl-c. It defaults to on
.
show may-interrupt
Show the current permission to interrupt or stop the program.
Previous: Interrupted System Calls, Up: Thread Stops [Contents][Index]