[英]GDB: Debug two instances of the same application simultaneous
我正在嘗試調試同一應用程序的兩個實例。 因此我設置如下:
(gdb) set target-async on
(gdb) set non-stop on
(gdb) attach pid1
(gdb) set scheduler-locking off
(gdb) add-inferior
(gdb) inferior 2
(gdb) attach pid2
(gdb) set scheduler-locking off
(gdb) b hello-world.cpp:8
Breakpoint 1 at 0x557a557761fd: ../hello-world.cpp:8. (2 locations)
(gdb) continue
我遇到的問題是只有當前選擇的劣質繼續。 有沒有辦法讓所有低級人員繼續執行一個命令?
解決方案:
如果使用以下序列,它將起作用:
(gdb) attach pid1
(gdb) add-inferior
(gdb) inferior 2
(gdb) attach pid2
(gdb) set schedule-multiple on
(gdb) b hello-world.cpp:8
Breakpoint 1 at 0x557a557761fd: ../hello-world.cpp:8. (2 locations)
(gdb) continue
感謝克勞斯!
最好的方法是使用第二個終端。 為什么你有這個只能使用一個的限制?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.