Hacker News new | ask | show | jobs
by shin_lao 2600 days ago
I see mentions of gdb - an extremely cumbersome tool - no mention of Visual Studio and its marvelous debugger.

I too, when I'm on Linux, don't use a debugger, because there's no good debugger and adding a print statement is faster and easier, and figuring out what is going on with gdb is just plain horrible and slow.

That's why as soon as I find a bug on Linux I try to have it on Windows to leverage VS's debugger. I can't count the number of times where I could instantly spot and understand a bug thanks to VS's debugger.

"Think harder about the code", sure, and what if you didn't write the code?

3 comments

I wrote 3Kloc of C++ for a dwarf fortress plugin while convalescing with very poor eyesight, and did not ever get around to figuring out how to start gdb, so crashes could involve alot of pondering or compiling in logging to track down simply where in the source it occurred.

A couple of months ago I finally had a go at using gdb to help fix a reported crash, and found that with a debug built executable, just type "gdb progname" and then at gdb's prompt "run" - hey presto if the program crashes it gives the source line. No problem that the entry executable wasnt built with symbols. It was hugely useful for a tiny learning step.

There is nothing marvelous about the VS debugger (it even had bugs on basic functionality up to very recently). It just presents an simpler interface because you are launching it from an IDE, get a C++ IDE on Linux and it will be as easy to launch.

But if you are looking for marvelous debuggers, I do recommend you look at the Python ecosystem.

Can you recommend specific python debuggers? I recently had to debug some py3 remotely and ended up using VS code, which worked but had some hiccups.
GDB can be very useful in certain situations. It has a very steep learning curve though. VS has very good tooling though, agreed.