I'm using gdb to debug a multithreaded program.
The program produces a lot of threads that repeatedly process a string (identical thread function).
In that loop, I wish to break if the string in any of these threads equals a predefined constant string. For this I'm using break myfile:1234 if $_streq(managedStr->value(), "testString")
.
But this breakpoint never gets hit, eventhough I know for sure that managestStr takes the value "testString" for sure.
When leaving the condition, it breaks, but when trying to evaluate the condition manually then, I get an error
The program stopped in another thread while making a function call from GDB.
From this link i learned to set the scheduler-locking
option while the program is paused, but setting this option from the very beginning didn't help with the breakpoint not being hit. Instead it will then get get
Error in testing breakpoint condition: The program stopped in another thread while making a function call from GDB. Evaluation of the expression containing the function (ManageString::value()) will be abandoned. When the function is done executing, GDB will silently stop. [Switching to Thread 0x7ffd35fb3700 (LWP 24354)]
What can I do to achieve the desired behaviour?