[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Renaming versions of the libraries?
From: |
Leo Razoumov |
Subject: |
Re: [Help-gsl] Renaming versions of the libraries? |
Date: |
Thu, 28 Jan 2010 11:30:42 -0500 |
On 2010-01-28, Brian Gough <address@hidden> 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--