On Sun, May 12, 2024 at 11:51:32AM -0700, Chris Bennett wrote: > I found a YouTube channel LowLevelLearning that covers various > programming languages in a manner that I find particularly helpful and > clear. For example comparing C and assembly on the same code is superb. > > In a short, he recommended valgrind to help finding memory leaks. > Other than splint and gdb, what other software is useful for working > with C? > I also wouldn't mind any other useful tips that might not be software. > Any help very appreciated.
I am sure gdb has some merits but for whatever C programs I wrote so far, a much more useful debugging technique was putting printf in right places and isolate the problem, and after that doing some mental work to actually understand why this seemingly correct line does something so wrong. This approach does not look sexy enough to show it on y-t, so I guess there will not be a movie showing it. Besides, all debuggers introduce their own perturbation and thus certain classes of error will be very hard to catch with them, if ever. It also sometimes happened to me, that debugger pointed to wrong place, where the error supposedly happened. Very wrong place - like GUI code when in fact the bug was in database communication. I think it all becomes even more funky if you start playing with multithreaded apps and languages which come with threads built-in, under the hood. All of those things happened many years ago - perhaps debuggers improved, I have no idea. So, I suggest that you do: man tee and after that: ./yourcode 2>&1 | tee log.txt and: less log.txt -- Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did "rm -rif" on the programmer's home ** ** directory. And then the C programmer became enlightened... ** ** ** ** Tomasz Rola mailto:tomasz_r...@bigfoot.com **