On 2010-01-28, Brian Gough <[email protected]> wrote: > At Wed, 27 Jan 2010 11:31:38 +0000, > > [..snip..] > The situation is that GNU packages always compile with debugging (-g > -O2) by default, so it should not be necessary to make a separate > debugging version -- it's part of the GNU philosophy that anyone > should be able to examine any program on the system. I've added a > note saying that to the INSTALL file. Unfortunately many > distributions don't follow this approach. >
This is a commendable philosophy which, unfortunately, does not work in practice. Due to optimizations, binary code compiled with "-g -O2" does not follow the source code. Stepping through a program with a debugger (gdb) is extremely painful. Some variables are optimized out, some functions get inlined, instructions are not in sync with source code. For debugging, I compile my code with "-g" or "-ggdb" and no any optimization flags at all. This policy serves me well. --Leo-- _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
