News for hackers. Stuff that matters.
Re:Building the Rust Compiler with GCC by CJefferson on Monday July 07, 2025 @12:56AM (#44486885)
I agree, recently I was working with a large Java program and after spending about 90 minutes (far too long, I was getting obsessed), I just gave up trying to get it into a debugger.

This is one area where rust disappoints me, there isn’t a “cargo debug” built in (there is an external program but it doesn’t work well), and when I just manually attach gdb most of the symbols are usually missing.

I would seriously consider a language billed as “debugger-first”, just to see what the experience was like.

Re:Building the Rust Compiler with GCC by dmitrygr on Monday July 07, 2025 @02:17AM (#44487264)
> I would seriously consider a language billed as “debugger-first”, just to see what the experience was like.

Use C, tell gdb "-O0 -g -ggdb3"

Re:Building the Rust Compiler with GCC by CJefferson on Monday July 07, 2025 @03:29AM (#44487617)
You are probably fairly accurate there, but that would require me going back and writing more C, which I've try to avoid nowadays :)

I still sometimes get caught out getting debug information all in the right place, particularly when someone is using ninja or some such, I've even ended up wrapping gcc just to strip optimisation options and add -g, rather than figure out how to fight some very complex build system mess.

Re:Building the Rust Compiler with GCC by gavinray on Monday July 07, 2025 @08:38AM (#44489755)
For Java programs, you run the JAR with a flag telling it to launch a remote-debug server listening on some port (traditionally 5005):

  java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
If your app is a gradle app, the flag is "--debug-jvm"

Then you connect to it with "jdb"

Re:Building the Rust Compiler with GCC by CJefferson on Monday July 07, 2025 @09:45AM (#44490332)
Thanks, I'll try that if I'm ever Java debugging again!

I don't think I want to do it myself, but I'd love a "101 ways to get into a debugger" webpage.