Hacker News new | ask | show | jobs
by cyberpunk 588 days ago
… If you are debugging c code surely you’re able to compile a debugger with whatever options you want?
1 comments

In theory, yes, but in practice, people who know how to compile gdb is a small subset of people who need to debug c code.

Not to mention that it actually takes extra time to do so, when people are used to debug Python/JavaScript/Go code with one single click these days.

Just grabbed the source, and it's a pretty bog standard ./configure ; make. Simple build instructions in the readme. Not sure this is a daunting challenge for any even moderately skilled developer.
Most people who use C nowadays are students, not "moderately skilled developers".

Students barely know how to manually put together a Makefile.

As long as the number of programmers is growing rapidly, it’s likely that most people who use any language are probably students. The distribution automatically skews toward beginner.

That has no bearing on whether we should have good tools for skilled developers, including debuggers & makefiles & source distributions. Eventually, students become moderately skilled. And we used gdb in class when I was a student.

> That has no bearing on whether we should have good tools for skilled developers, including debuggers & makefiles & source distributions.

Unfortunately, it's also the best explanation as for why we don't have them in practice, and why all software seems perpetually developed by fresh juniors (because it is).

I don’t quite understand where this is going nor why. This little sub-thread stemmed from a good tool that does already exist, and from unsubstantiated claims that C devs are students and that the simple build steps are too hard for most people. Sure, a lot of software is written by junior devs but that has no bearing on whether gdb exists, or even how hard it is to build. We have lots of good debuggers, and luckily it only takes a few experts to write them, which is why we do have them in practice.
> Most people who use C nowadays are students, not "moderately skilled developers".

That seems a very dubious claim, especially since most students begin with Python or JS. Do you have any data to back that up?

Where? How?

Last time I tried to build GDB from source, which was some two months ago, it wasn't in any way simple. GDB comes embedded in some GNU binutils repo, instructions to build it in isolation weren't obvious.

I ended up creating a new VM with a more recent Linux distro, that came with newer GDB, and migrating everything I'm working on to it, because that was much easier than building GDB from source.

The GDB source is available as a standalone package: https://www.sourceware.org/gdb/download/
I'm not sure where you've been looking, but source tarballs have been available from both gnu.org and the GDB website for over 20 years, with every major release going back 30 years available for download.