赛派号

十大公认最好用的散粉平价品牌 GDB Command Reference

Index > Breakpoint and watchpoint management 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 Breakpoint and watchpoint management

,

break

,

clear

,

disable

,

enable

,

info breakpoints

,

set multiple-symbols

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了