Rather than delete a breakpoint or watchpoint, you might prefer to
disable it. This makes the breakpoint inoperative as if it had
been deleted, but remembers the information on the breakpoint so that
you can enable it again later.
You disable and enable breakpoints and watchpoints with the
enable and disable commands, optionally specifying one or
more breakpoint numbers as arguments. Use info break or
info watch to print a list of breakpoints or watchpoints if you
don't know which numbers to use.
A breakpoint or watchpoint can have any of the following states:
- Enabled
- The breakpoint stops your program. A breakpoint set
with the break command starts out in this state.
- Disabled
- The breakpoint has no effect on your program.
- Enabled once
- The breakpoint stops your program, but then becomes
disabled. A breakpoint set with the tbreak command starts out in
this state.
- Enabled for deletion
- The breakpoint stops your program, but
immediately afterwards it's deleted permanently.
You can use the following commands to enable or disable breakpoints and
watchpoints:
-
disable [breakpoints] [bnums...]
- Disable the specified breakpoints—or all breakpoints, if none is
listed. A disabled breakpoint has no effect but isn't forgotten. All
options such as ignore-counts, conditions and commands are remembered in
case the breakpoint is enabled again later. You may abbreviate
disable as dis.
-
enable [breakpoints] [bnums...]
- Enable the specified breakpoints (or all defined breakpoints). They
become effective once again in stopping your program.
-
enable [breakpoints] once
bnums...
- Enable the specified breakpoints temporarily. GDB disables any
of these breakpoints immediately after stopping your program.
-
enable [breakpoints] delete
bnums...
- Enable the specified breakpoints to work once, then die. GDB
deletes any of these breakpoints as soon as your program stops there.
Except for a breakpoint set with tbreak (see
"Setting breakpoints"),
breakpoints that you set are initially enabled;
subsequently, they become disabled or enabled only when you use one of
the commands above. (The command until can set and delete a
breakpoint of its own, but it doesn't change the state of your other
breakpoints; see
"Continuing and stepping.")