Disabling The Scheduler
The solution - gdb allows us to disable the threads scheduler:
set scheduler-locking off
Now, if we type 'step' or 'next' (or even 'cont'), only the current thread will run.
We may use 'set scheduler-locking on' to revert to normal scheduling mode.
We may use 'set scheduler-locking step' to disable the scheduling only when using 'step'...
(Using 'next' will still allow thread scheduling in this mode).
Originally written by