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
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
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
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
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
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:
>
>
> 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
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
On May 12 11:51:32, cpb_m...@bennettconstruction.us wrote:
> In a short, he recommended valgrind to help finding memory leaks.
man malloc
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
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
11 matches
Mail list logo