版权声明:欢迎转发,转发请标明出处 https://blog.csdn.net/weixin_39465823/article/details/88927559
彻底清除停止点:
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00005555555548dc in main at strcopy.c:46
stop only if i=10
breakpoint already hit 1 time
2 breakpoint keep y 0x00005555555548dc in main at strcopy.c:47
stop only if i==10
breakpoint already hit 1 time
3 breakpoint keep y 0x00005555555547f9 in MyStrCopy2
at strcopy.c:30
stop only if p=="string copy"
4 breakpoint keep n 0x00005555555547ce in MyStrCopy2
at strcopy.c:28
stop only if s2=="string copy"
5 hw watchpoint keep y i
breakpoint already hit 1 time
6 read watchpoint keep y i
7 acc watchpoint keep y i
breakpoint already hit 1 time
(gdb) delet breakpoint 1-2
(gdb) info break
Num Type Disp Enb Address What
3 breakpoint keep y 0x00005555555547f9 in MyStrCopy2
at strcopy.c:30
stop only if p=="string copy"
4 breakpoint keep n 0x00005555555547ce in MyStrCopy2
at strcopy.c:28
stop only if s2=="string copy"
5 hw watchpoint keep y i
breakpoint already hit 1 time
6 read watchpoint keep y i
7 acc watchpoint keep y i
breakpoint already hit 1 time
暂时或者条件删除/禁止停止点:
禁止断点4
(gdb) disable breakpoints 4
使能断点4
(gdb) enable breakpoints 4
(gdb) info break
Num Type Disp Enb Address What
3 breakpoint keep y 0x00005555555547f9 in MyStrCopy2
at strcopy.c:30
stop only if p=="string copy"
4 breakpoint keep y 0x00005555555547ce in MyStrCopy2
at strcopy.c:28
stop only if s2=="string copy"
(gdb) disable breakpoints 4
(gdb) info break
Num Type Disp Enb Address What
3 breakpoint keep y 0x00005555555547f9 in MyStrCopy2
at strcopy.c:30
stop only if p=="string copy"
4 breakpoint keep n 0x00005555555547ce in MyStrCopy2
at strcopy.c:28
stop only if s2=="string copy"
用一次就停止断点4
(gdb) enable breakpoints once 4
用一次就停止断点3-4
(gdb) enable breakpoints once 3-4
用一次就删除断点4
(gdb) enable breakpoints delete 4
用一次就删除断点3-4
(gdb) enable breakpoints delete 3-4