6.基础命令(delete)

6.1 delete<断点编号>(删除指定断点)

(gdb) i b 
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000001597 in main(int, char**) at main.cpp:46
2       breakpoint     keep y   <PENDING>          FUN
3       breakpoint     keep y   <MULTIPLE>
3.1                         y   0x0000000000001379 in testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at main.cpp:17
3.2                         y   0x00000000000013f1 in testFun(int) at main.cpp:26
(gdb) clear
No source file specified.
(gdb) d 2
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000001597 in main(int, char**) at main.cpp:46
3       breakpoint     keep y   <MULTIPLE>
3.1                         y   0x0000000000001379 in testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at main.cpp:17
3.2                         y   0x00000000000013f1 in testFun(int) at main.cpp:26

6.2 delete<断点编号>(删除指定断点)

d命令可以直接删除全部断点

(gdb) c
Continuing.
num:9988
cnt:199
buf:zzxx

Breakpoint 3.1, testFun (str="xxxx") at main.cpp:17
17          printf("str:%s\n", str.c_str());                                                                              
(gdb) d
Delete all breakpoints, watchpoints, tracepoints, and catchpoints? (y or n) y
(gdb) i b
No breakpoints, watchpoints, tracepoints, or catchpoints.
(gdb) 

posted @ 2026-05-19 22:48  BlackSnow  阅读(14)  评论(0)    收藏  举报