Debugging Vs Printing (hackaday.com)
from cm0002@piefed.world to programming@programming.dev on 12 Sep 02:40
https://piefed.world/post/462189

#programming

threaded - newest

atzanteol@sh.itjust.works on 12 Sep 04:21 next collapse

The entire article: You can do things with a debugger that you can’t do with print statements.

Lembot_0004@discuss.online on 12 Sep 05:14 collapse

And print statements can do things that are impossible for the debugger (quick example before you start rage: last program I wrote needed some information about short-lived processes that I know only pid about. If I would use a debugger, the OS would already delete all the data I need to analyze)

Valmond@lemmy.world on 12 Sep 10:48 next collapse

Yeah, multi threadin/multi processing is a bitch to debug sometimes and prints/logs can really help.

wildbus8979@sh.itjust.works on 12 Sep 12:49 collapse

Wrap the launching of that process with the debugger, problem solved.

Lembot_0004@discuss.online on 12 Sep 13:01 collapse

Wrapping the kernel with GDB is the last thing I want to do with my life :)

wildbus8979@sh.itjust.works on 12 Sep 15:48 collapse

If it has an unstable pid, then you aren’t debugging the kernel.

syklemil@discuss.tchncs.de on 12 Sep 08:06 next collapse

Why is this linking to what appears to be another link aggregator, rather than what appears to be the original blog post?

frezik@lemmy.blahaj.zone on 12 Sep 13:02 collapse

Now try debugging on a microcontroller with none of that UART stuff Arduino gives you. Print statements? Ha, try debugging by blinking an LED.

TheAgeOfSuperboredom@lemmy.ca on 12 Sep 13:47 collapse

LED? Luxury! 😁

I had one board with an improperly loaded power supply and I could tell what it was doing by the pattern and pitch of the squeal.

It did have a debug UART though, but I did come to find the sound pretty useful too!

frezik@lemmy.blahaj.zone on 12 Sep 13:50 collapse

Heh, kinda like knowing if your 56Kinda modem got a good connection or not.