I'm debugging a multithreaded C++ program with gdb. Here's the debugging flow I'd like to achieve:
- run until a breakpoint, then pause execution for all threads
- disable [breakpoints] with the
disablecommand - call a function (defined in my program) to print the state of a vector (while keeping the other threads paused)
However, 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:
- do other threads resume execution while a
callcommand is executed in gdb? - assuming so, is there a way to disable this such that I can
keep threads paused while I introspect program state via
callcommands?
set scheduler-locking ondoes what I want - Kulluk007