我可以在GDB中添加一个断点:
b <filename>:<line no>
如何删除特定位置的现有断点?
答案 0 :(得分:244)
您可以使用以下内容列出断点:
info break
这将列出所有断点。然后可以通过相应的数字删除断点:
del 3
例如:
(gdb) info b
Num Type Disp Enb Address What
3 breakpoint keep y 0x004018c3 in timeCorrect at my3.c:215
4 breakpoint keep y 0x004295b0 in avi_write_packet atlibavformat/avienc.c:513
(gdb) del 3
(gdb) info b
Num Type Disp Enb Address What
4 breakpoint keep y 0x004295b0 in avi_write_packet atlibavformat/avienc.c:513
答案 1 :(得分:102)
试试这些(reference):
clear linenum
clear filename:linenum
答案 2 :(得分:18)
您可以使用
删除所有断点del <start_breakpoint_num> - <end_breakpoint_num>
要查看 start_breakpoint_num 和 end_breakpoint_num ,请使用:
info break
答案 3 :(得分:2)
使用:
clear fileName:lineNum // Removes all breakpoints at the specified line.
delete breakpoint number // Delete one breakpoint whose number is 'number'