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

delete command

Deletes specified breakpoints or all breakpoints.

Syntax

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

Parameters

Number
When the delete is invoked without any arguments, it deletes all breakpoints. When one or more numbers are specified, only the breakpoints matching the specified numbers will be deleted.

Attention

Do not confuse this command with the clear comand that accepts location rather than a breakpoint number.

Remarks

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

Examples

In this command we will set a breakpoint inside a loop and then disable it once it hits.

(gdb) break 6
Breakpoint 1 at 0x80483f7: file test.cpp, line 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 keep y 0x080483f7 in main() at test.cpp:6
breakpoint already hit 1 time
(gdb) delete 1
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) continue
Continuing.
0
1
2
3
4
[Inferior 1 (process 26609) exited normally]

Common errors

If you accidentially use the clear command instead of the delete commmand, the argument will be interpreted as the line number and not the breakpoint number. This may result in deleting a different breakpoint than you would expect or fail with an error message:

(gdb) break 6
Breakpoint 1 at 0x80483f7: file test.cpp, line 6.
(gdb) clear 1
No breakpoint at 1.
(gdb) delete 1
(gdb) info breakpoints
No breakpoints or watchpoints.

Compatibility with VisualGDB

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

See also