Using GDB’s ‘po’ Command While a Malloc Lock Is Being Held
What this does, when enabled, is to cause GDB to only run the current thread when you click the “Continue” button or use the “continue” command from the GDB console, rather than running all threads at once. To enable this behavior, you can simply type “set scheduler-locking on” on the console.