How to continue one thread at a time when debugging a multithreaded program in GDB?

后端 未结 3 1018
花落未央
花落未央 2020-12-08 00:38

I have a program which uses two threads. I have put the break point in both the threads. While running the program under gdb I want to switch between the threads and make th

3条回答
  •  情深已故
    2020-12-08 01:10

    If you're using GDB 7 or later, try "non-stop mode".

    http://sourceware.org/gdb/current/onlinedocs/gdb/Non_002dStop-Mode.html

    The "scheduler-locking on" command previously mentioned allows you step one thread with the others stopped. Non-stop mode allows you to step one thread with the others active.

提交回复
热议问题