Re: What software to debugging and analyzing C?

2024-05-16 Thread j
But you do realise that adding printf() calls to the code can also change, for example, the memory layout that the compiler uses, so certain memory allocation bugs might become more or less easily triggerable? This is a big deal especially debugging code that fails with -O3 but succeeds

Re: What software to debugging and analyzing C?

2024-05-14 Thread Tomasz Rola
On Tue, May 14, 2024 at 05:19:43AM -0300, Crystal Kolipe wrote: > On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote: > > 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

Re: What software to debugging and analyzing C?

2024-05-14 Thread Chris Bennett
On Tue, May 14, 2024 at 05:19:43AM -0300, Crystal Kolipe wrote: > On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote: > > 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

Re: What software to debugging and analyzing C?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 11:40:42 2024 Tomasz Rola wrote: > 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, I got used to doing this too. I started doing it intuitively, I'm

Re: What software to debugging and analyzing C?

2024-05-14 Thread Crystal Kolipe
On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote: > 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

Re: What software to debugging and analyzing C?

2024-05-13 Thread Chris Bennett
On Mon, May 13, 2024 at 08:24:38AM +0200, Janne Johansson wrote: > pkg_add llvm and run "scan-build" on your code, then you get a quite > thorough analysis on what potential error code paths it detects, with > fancy webpages to go along with the explanations for each found issue: > >

Re: What software to debugging and analyzing C?

2024-05-13 Thread Janne Johansson
> 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

Re: What software to debugging and analyzing C?

2024-05-12 Thread Tomasz Rola
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

Re: What software to debugging and analyzing C?

2024-05-12 Thread Jan Stary
On May 12 11:51:32, cpb_m...@bennettconstruction.us wrote: > In a short, he recommended valgrind to help finding memory leaks. man malloc

Re: What software to debugging and analyzing C?

2024-05-12 Thread Walter Alejandro Iglesias
Otto Moerbeek thought me this: First compile your program with debug symbols (and, conveniently, without optimization settings.) $ DEBUG="-g -O0" make Then: $ MALLOC_OPTIONS=D ktrace -tu $ kdump -u malloc kdump will though you lines like this: 0x34f10a4b153 20480 1 20480

What software to debugging and analyzing C?

2024-05-12 Thread Chris Bennett
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