ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
gdb can, pretty much. The 'bt' command will show a complete backtrace of the program, up until the segfault (or other signal). It won't, however, actually show you incidental function calls (if I call a function Function1(), and then call another one - Function2(), and a sigfault happens in Function2(), you won't see any record of Function1() anywhere in the backtrace).
Last edited by rose_bud4201; 02-23-2006 at 03:48 PM.
Reason: re-read your question and realized my example was crap
Oh, UGH. Yeah, gdb with threaded programs is going to be nine kinds of hell, no matter which way you slice it.
If it's a logic bug somewhere, the only thing I can suggest is cut it down to 1 child process at a time, and start working with breakpoints, printing out all of the frame information at each breakpoint.
If it's something more complex, like a race condition...I'm not sure what to tell you. Those are usually manual and painful to debug, and if using a tool a more sophisticated one than plain gdb is probably necessary. A quick google search revealed a tool called 'smartGDB', which appears to have support for debugging individual threads. It looks like it's not been updated since 1999, but it was at version 1.0 then. That (or something like it) may be worth a shot :-/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.