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.
Distribution: OpenSuse 10.2, Slackware 11, Solaris 10
Posts: 415
Rep:
programming tools to aid C development
Hi,
I wanted to ask about the popular tools to aid the development of C applications.
Tools which would allow me to avoid as much as possibe the infamous "Segementation Fault".
I've used gdb, ddd (gui frontend) but didnt find it of much use to track the causes of seg faults.
I use gdb a lot for debugging C/C++ code, and it's probably the most flexible and powerful C/C++ debugger there is, although that means it's also pretty hard to use. The learning curve is high, but any time spent learning it will ultimately be worth it.
That aside, another useful tool for debugging C/C++ code would be a system-call tracer. On BSD systems, you've got ktrace available right out of the box; another good one is strace. I don't know if ktrace is available for Linux, but strace is available for both Linux and *BSD.
Tools:
Part of Linux - mtrace, electric fence
Other tools - splint, uno, clint, valgrind, gprof
You can google for tutorials, and if you don't have the tool, you can download and install it. For example, electric fence is normally just linked in to your executable. You run the code, it complains.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.