Debugging
From WarzoneWiki
Compilation tips
- To get really useful output, you need -g (debug symbols), because otherwise information like file and linenumber is not stored.
- Make sure not to strip the binary (strip is a command to remove "unnecessary" symbols)
- On x86, do not use -fomit-frame-pointer: That will remove the capabilty to get any backtraces, even if you did not strip the binary. (On x86_64 or ppc you can omit the frame pointer, and in fact it is enabled by default on -O1 or higher. They use a different method to build a backtrace (without a frame pointer).)
- Any optimisation level (-O1 or higher and also -Os) will change the structure of the generated code, which thus may contain less useful information (like temporary variables). Sometimes such variables (or small functions, etc) are not required to determine the source of a crash, at other times they are crucial. So you better stay with -O0 when doing debug builds.


