Reputation: 5188
I have a program that takes a lot of memory and time to compile. I measured that without debugging symbols, compilation takes much less resources, but I would like to always have them, even for "release" builds so that I crash dumps are meaningful.
Is it possible to create debugging symbols (-ggdb3
) with either gcc or clang for an executable that has not been originally compiled with them? I've been told that just recompiling the program with -ggdb3
works, but I don't know how much this is reliable.
Upvotes: 0
Views: 691
Reputation: 8573
Assuming the build chain is deterministic, which is a highly desirable goal for tool chains, and assuming you have not changed the source in any meaningful way (which practically means in any way at all), then running it again will be reliable. However, I am sure it is possible to demonstrate examples when this doesn't go as planned. So, as your intuition suggests, building the debugging symbols simultaneously should be considered a Good Thing.
Upvotes: 1