11 comments

[ 31.3 ms ] story [ 1024 ms ] thread
This article will focus on ELF files on Linux. For other formats and platforms, things are likely to be quite different.

Indeed they are. It's interesting to contrast the cultural background for these decisions; on Windows, and DOS before that, debug symbols were always separate files. Personally I prefer that, both from the perspective of reducing unwanted bloat (I bet 99% or more of users who use the executable will never need nor want the debug symbols) and better privacy defaults --- it won't disclose unnecessary information about the source.

[flagged]
Wow. "bad guys who write proprietary software" is... not even wrong.

Why should I be forced to disclose information I don't want to?

"You have nothing to hide"? Fuck that.

Are you equating proprietary software with privacy, and FOSS with "you have nothing to hide"? Proprietary software is way worse for privacy than FOSS is.
If I buy a lawn mower from John Deer, I should have a right to unscrew the top, look inside, and make repairs. I own the lawn mower. It's being used on my lawn.

If I buy a printer from Canon, I should have the right to refill the ink cartridge with ink from anywhere.

If I download or buy a piece of software from you and run it on my hardware, I should have the right to look at the source code, make changes and repairs, and run the modified copy. I purchased the program from you or you gave it to me, it's being run on my hardware.

That is the essence of the argument for user freedom - a right to be able to understand and change the code you're running on your hardware. The parallels to the "right to repair" movement should be clear.

If you buy that logic, then yes, it is a "bad guy" (or really a "bad company") which deprives users of their right to know what is happening on their own hardware, deprives users of the ability to make simple repairs to software they "own".

You could embed names, function argument names and locals in an executable as well on Windows until ... probably VS2003 or so. Here's the documentation for it in VS 6.0: https://learn.microsoft.com/en-us/previous-versions/visualst...

/Z7 and /Zd result in an exe/dll with no seperate pdb. You could however split it into exe/dll + .dbg.

In .NET we actually went back to an embedded symbol format, which has several advantages. However, the symbol format is more compact than the classic PDBs though.
I apologize for the moderately OT help request, but as Tweag has some great nix / rust content, and this is about debugging, I thought some HNers with relevant interests might swing by -- I am going nuts trying to get debugging working for nix-compiled rust on an M1 Mac (via llvm). My posts to the nix forum, rust forum, and my nixpkgs repo have gone without response, and I'm a humble hobbyist that is running out of ideas. If anyone has any ideas or suggestions, please take a look at https://github.com/NixOS/nixpkgs/issues/262131 -- TIA, and I apologize again if this detracts from the OP!