gdb學習14 清除停止點

2021-09-14 04:49:46 字數 2709 閱讀 1502

徹底清除停止點:

(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

參考:

成功解決 docker 清除所有已停止容器

docker rm docker ps a grep exited awk docker rm yyy zzz docker 刪除容器 yyy,zzz,這個可以連續寫 docker ps a 這個是輸出所有的容器 grep exited 將行中帶有exited的所有行輸出 awk 將每一行的第乙個短...

gdb積累學習

gdb積累學習 1 檢視當前檔案 通過gdb進行除錯的時候,有的時候因為跳轉的太多,所以不知道已經執行到了哪乙個檔案,這個時候,如果我們想看一下當前檔案的名字,可以使用下面的命令 gdb info source current source file is cdbstatement.cpp comp...

gdb除錯學習

一般來說,gdb主要幫忙你完成下面四個方面的功能 1 啟動你的程式,可以按照你的自定義的要求隨心所欲的執行程式。2 可讓被除錯的程式在你所指定的調置的斷點處停住。斷點可以是條件表示式 3 當程式被停住時,可以檢查此時你的程式中所發生的事。4 動態的改變你程式的執行環境。除錯的程式如下 root lo...