I'm debugging a multithreaded C++ program with gdb. Here's the debugging flow I'd like to achieve:
disable
commandHowever, when I make the call to the function that prints the state of the system multiple times, the values of the data structure change. Unless I have some sort of other bug, this must mean that the other threads are running while my printing function is running.
Questions:
call
command is executed
in gdb? call
commands?See @KostasRim's comment -- set scheduler-locking on
achieves the desired behavior (https://sourceware.org/gdb/onlinedocs/gdb/All_002dStop-Mode.html). By default, other threads run during stepping, function calling, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With