I have a program that I intend to distribute to end users, and would like to have receive crash reports from them. If I were using MSVC, I would generate minidumps and have those sent to me, and then inspect them with the corresponding PDB to get a useful stack trace, at the very least.
What is the equivalent of doing this with GCC? I can generate a stack trace, but if I want this to be useful, it requires having debug symbols compiled into the executable (with -g). Obviously this is unacceptable for release distribution, since the executable can balloon in size quite a bit.
I googled a bit and found references to objcopy being able to separate out debug symbols to a separate file, but that page implied I would still need to have the debug symbols available alongside the release executable, which again is obviously unacceptable.
I couldn’t find an exact answer to this, but I found an alternate solution that works just as well: Compile with optimization and other release flags alongside
-g, store the resulting executable somewhere, then remove debug symbols usingstrip. Ship the stripped executable, and when you get a stack trace, useaddr2linein combination with the original, unstripped executable, and you should get all the symbols back.