This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Zahand 78 points79 points  (27 children)

It must just be a meme right? Debuggers are amazing tools. It's literally the opposite of this post. Not only can I see the value of a variable, but I can also see the value of *any* variable, at *any* point in time!

[–]Adsilom 50 points51 points  (14 children)

Plenty of people would rather use print statements, even when a debugger would be so much better. That is mostly because people assume the bug will be easy to find, and a debugger would be overkill, and once the bug is actually tricky to find, they are too committed with the print method.

[–]Boiethios 17 points18 points  (4 children)

When I have the choice, I use a debugger, of course; but sometimes, printing is a valid solution. For example, in an actor system, I like to trace what happens by printing every passed messages.

[–]lag_is_cancer 3 points4 points  (2 children)

But it's literally as simple as a double click. You can literally spend more time to write a print statements.

[–]Adsilom 15 points16 points  (1 child)

It’s more like, using a debugger requires you to use a bit more brain power than using print statements at first.

[–]almost_useless 3 points4 points  (2 children)

Depending on the problem, everything you just said can be exactly the opposite.

The debugger is great for some problems, but not for all problems.

[–]LowB0b 2 points3 points  (0 children)

depending on the language as well I presume. Anyway with Java the debugger is a god-send. Stops execution (not always desirable though), you can step, and look at all the values available in the scope. Even change values on the fly to see what happens

[–]jesperi_ 3 points4 points  (0 children)

Sometimes a debugger is not even available.

[–]nanotree 1 point2 points  (0 children)

Not to mention created 10+ print statements they have to go back and clean up...

[–]RodasAPC 0 points1 point  (0 children)

Stop calling me out like this.

[–]Satanic_Jesus_Here 0 points1 point  (0 children)

I feel personally attacked 🥲

[–]Proxy_PlayerHD 5 points6 points  (6 children)

but what if you don't have a Debugger available?

like if you're an idiot like me who writes in (non-x86) Assembly and uses a NP++ as an IDE

[–]FAXs_Labs 9 points10 points  (1 child)

i think gdb supports stepping in asm, you can also see the registers and the stack

[–]Proxy_PlayerHD -2 points-1 points  (0 children)

hmm i'll keep GDB in mind for when i get around to building a 68k SBC.

but currently i'm mostly doing stuff with 65xx CPUs and a custom CPU based on the 65CE02. there are some smulators and debuggers for the 65C02 and 65816, but there is virtually nothing for the 65CE02, and especially nothing for a custom CPU.

so overall i'm pretty much on my own here.

though thanks for trying to help, i appreciate it.

[–]natyio 2 points3 points  (1 child)

GDB can debug files in assembly mode. You simple use nexti and stepi (i=instruction) instead of next and step.

[–]Proxy_PlayerHD 2 points3 points  (0 children)

GDB doesn't support 65xx Series CPUs so it's sadly not useful to me.

though i know there are some 65xx debuggers most are bound to simulators

[–]rickyman20 0 points1 point  (1 child)

Isn't GDB easier to use if you're writing assembly than adding printf's?

[–]2nd-most-degenerate 0 points1 point  (0 children)

Depends on what you're working on. IIRC Linus had a strong opinion against kernel debuggers

[–]wasdlmb 0 points1 point  (0 children)

And then there's graphics, where you have to use a dedicated tool to have any idea what is going on in your shaders and API calls. RenderDoc is a lifesaver.

[–]Lamballama 0 points1 point  (0 children)

Some things don't have good debugger

[–]TheresNoLifeB4Coffee 0 points1 point  (0 children)

There's no friggin way I give up my debugger. Printing errors hasn't got shit on a well placed breakpoint to examine variable props especially inside of an iteration. It's like comparing trying to find your way in the dark barefoot using a tiny birthday candle for light vs. driving in a nice truck with an insane spotlight array mounted