Re: [HACKERS] --enable-debug does not work with gcc

2007-02-19 Thread Bruce Momjian
Added to developer's FAQ: PIsrc/Makefile.custom/I can be used to set environment variables, like ICUSTOM_COPT/I, that are used for every compile. --- Magnus Hagander wrote: If we did what you suggest, then

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-03 Thread Matthias Luedtke
Hi all, Magnus Hagander wrote: Personally, in my development tree I use a Makefile.custom containing # back off optimization unless profiling ifeq ($(PROFILE),) CFLAGS:= $(patsubst -O2,-O1,$(CFLAGS)) endif -O1 still generates uninitialized variable warnings but the code is a lot saner to

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-03 Thread Peter Eisentraut
Matthias Luedtke wrote: And while we are at it, how about some CFLAGS=-DOPTIMIZER_DEBUG sweetness for the debugging section in the Dev FAQ? Most of the debugging macros are not documented because their purpose only arises out of the source code. -- Peter Eisentraut

[HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread NikhilS
Hi, configure with --enable-debug does not seem to add -g to CFLAGS while compiling with gcc. Guess we will need to change configure.in as below: *** # supply -g if --enable-debug ! if test $enable_debug = yes test $ac_cv_prog_cc_g = yes; then CFLAGS=$CFLAGS -g fi --- 300,315

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread Gavin Sherry
On Fri, 2 Feb 2007, NikhilS wrote: Hi, configure with --enable-debug does not seem to add -g to CFLAGS while compiling with gcc. Guess we will need to change configure.in as below: Erm... works for me and everyone else... AFAIK. Thanks, Gavin ---(end of

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread NikhilS
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

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread Gavin Sherry
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.

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread NikhilS
Hi, On 2/2/07, Gavin Sherry [EMAIL PROTECTED] 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

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread Tom Lane
NikhilS [EMAIL PROTECTED] writes: 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? If we did what you

Re: [HACKERS] --enable-debug does not work with gcc

2007-02-02 Thread Bruce Momjian
Tom Lane wrote: NikhilS [EMAIL PROTECTED] writes: 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?