GDB has severe issues when debugging with multiple threads (pthreads). Are there any other good multi-threaded debuggers for C/C++ on *nix?
-
This should also be tagged 'gdb'. – jfm3 Sep 16 '08 at 21:59
-
I seem to having problem debugging a thread class that is instanctiated multiple times(SEGMENTATION FAULT). Is it me or is it GDB's fault. At run time I dont have any seg faults – yan bellavance May 18 '10 at 23:23
-
You need to post a new question for something like that, Yan. Also, I suggest you provide a lot more information when/if you do so; you’ve provided no useful information to allow us to help you fix your problem. – ELLIOTTCABLE Jun 27 '10 at 6:35
I've personally not had any GDB specific issues when debugging a multi-threaded application, so it may helpful for you to elaborate on exactly what "issues" you are having. It will help us answer you better.
There are several aids that I have used in the past when debugging multi-threaded applications in linux, most of which build upon GDB rather than replace it. These include:
- DDD http://www.gnu.org/software/ddd/
- Eclipse http://www.eclipse.org/
- Native POSIX Thread Library (NTPL) Trace Tool http://nptltracetool.sourceforge.net/
Additionally, if you are new to debugging in Linux (and even if you aren't!) I highly recommend the paper titled "Debugging Linux Applications" which you can find here:
http://www.scribd.com/doc/3009706/Debugging-Linux-Applications
Allinea DDT ... graphical debugger for scalar, multi-threaded and large-scale parallel applications that are written in C, C++ and Fortran.
TotalView is what the national labs use for huge clusters. I believe it has some good support for thread parallelism, too. It's probably out of your price range, but you can try it for free.
From my search, I have not found any good multi-thread debuggers for *nix. GDB seems to be getting better, and the last time I had to debug a multi-threaded application on FreeBSD (7.0-RELEASE) it behaved fairly well, letting me find where the error was.
I once looked for a gdb alternative, but unfortunately every one I found was based on gdb. I think this is because gdb is intricately tied to gcc, and it's hard for third-party debuggers to keep up with every gcc change.