Thursday, July 23, 2020

GDB in threaded code

GDB ( ) is a handy way to debug command line applications. But in the case of applications that are running many threads, it doesn't by default follow a single thread, so as you step through the code it jumps between threads and it's easy to lose track of where you are. The solution is the scheduler-locking command, which forces the stepper to only step through one active thread at a time.

(gdb) set scheduler-locking on

See here for details:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.