Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-threaded debugging tutorial for GDB and C [closed]

Does anybody know of a good GDB (or other Linux debugger) tutorial for debugging multi-threaded C code? I'm looking for one that includes simple examples.

like image 667
Josh Avatar asked Nov 08 '09 03:11

Josh


People also ask

Is GDB multithreaded?

GDB provides these facilities for debugging multi-thread programs: automatic notification of new threads. ' thread thread-id ', a command to switch among threads. ' info threads ', a command to inquire about existing threads.

How do I see all threads in GDB?

Use the "info threads" command to see the IDs of currently known threads. The GDB thread debugging facility allows you to observe all threads while your program runs--but whenever GDB takes control, one thread in particular is always the focus of debugging. This thread is called the current thread.

Why it is difficult to debug multi threaded programs?

Parallel processing using many threads can greatly improve program performance, but it may also make debugging more difficult because you're tracking many threads. Multithreading can introduce new types of potential bugs.


1 Answers

Googled it.Found some links.They seem helpful :

  • redhat.com -Debugging programs with multiple threads
  • Multi-threaded Debugging Techniques
like image 72
Pale Blue Dot Avatar answered Sep 24 '22 04:09

Pale Blue Dot