Supported on windows
Supported on linux
Supported on embedded
Supported on android

enable command

Enables all breakpoints or specified breakpoints. This command can also enable breakpoints for just one hit.

Syntax

enable
enable [Number]
enable [Number1] [Number2] ... [NumberN]
enable delete [Number]
enable delete [Number1] [Number2] ... [NumberN]
enable once [Number]
enable once [Number1] [Number2] ... [NumberN]
enable breakpoints ...

Parameters

Number
When the enable is invoked without any arguments, it enables all breakpoints. When one or more numbers are specified, only the breakpoints matching the specified numbers will be enabled.
delete
When specified, the enabled breakpoints will be automatically deleted after the first hit. Note that you cannot use this parameter without specifying one or more breakpoint numbers.
once
When specified, the enabled breakpoints will be automatically disabled after the first hit. Note that you cannot use this parameter without specifying one or more breakpoint numbers.

Remarks

Use the disable command to disable breakpoints, delete command to delete them, or the info breakpoints command to display information about breakpoints.

Examples

In this command we will set a breakpoint inside a loop and set it to be disabled after the first hit.

(gdb) break 6
Breakpoint 1 at 0x80483f7: file test.cpp, line 6.
(gdb) enable once 1
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint dis y 0x080483f7 in main() at test.cpp:6
(gdb) run
Starting program: /home/testuser/test
Breakpoint 1, main () at test.cpp:6
6 printf("%di);
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint dis n 0x080483f7 in main() at test.cpp:6
breakpoint already hit 1 time
(gdb) enable delete 1
(gdb) continue
Continuing.
0
Temporary breakpoint 1, main () at test.cpp:6
6 printf("%di);
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) continue
Continuing.
1
2
3
4
[Inferior 1 (process 26479) exited normally]

Compatibility with VisualGDB

Normally you do not need to run the enable command under VisualGDB. Please use the Breakpoints window in Visual Studio to view and manage your breakpoints.

See also