Skip site navigation (1) Skip section navigation (2)

Re: --enable-debug does not work with gcc

From: NikhilS <nikkhils(at)gmail(dot)com>
To: "Gavin Sherry" <swm(at)alcove(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: --enable-debug does not work with gcc
Date: 2007-02-02 09:13:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

On 2/2/07, Gavin Sherry <swm(at)alcove(dot)com(dot)au> wrote:
> On Fri, 2 Feb 2007, NikhilS wrote:
> > Hi,
> >
> > Indeed it does, apologies for not doing the entire groundwork. But what
> it
> > also does is that it adds -O2 by default for gcc even when
> --enable-debug is
> > specified. gdb is not able to navigate the stack traces properly with
> this
> > optimization in place. Especially tracing of static functions becomes
> > difficult. Has this issue been faced by anybody else? If so can try out
> a
> > patch to avoid using O2 with enable-debug.
> Yes, this is known. The thing with gcc is, it only emits some warnings at
> -O2. I'm not that this is why we do not set optimisation to 0 but have
> long assumed it to be the case. I imagine that it's fairly standard
> practice for people doing debugging to CFLAGS=-O0 as an argument to
> configure.
> True, this is how I myself circumvent this problem too. But IMHO,
explicitly passing CFLAGS when we are invoking --enable-debug (which does
add -g, but leaves some optimization flag around which deters debugging)
does not seem correct?



In response to


pgsql-hackers by date

Next:From: Michael MeskesDate: 2007-02-02 09:28:11
Subject: Re: [GENERAL] 8.2.1 Compiling Error
Previous:From: Gavin SherryDate: 2007-02-02 09:05:48
Subject: Re: --enable-debug does not work with gcc

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group