[英]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.