Re: Patch - Debug builds without optimization

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Patch - Debug builds without optimization
Дата
Msg-id 1308239462-sup-1118@alvh.no-ip.org
обсуждение исходный текст
Ответ на Patch - Debug builds without optimization  (Radosław Smogura <rsmogura@softperience.eu>)
Ответы Re: Patch - Debug builds without optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Excerpts from Radosław Smogura's message of jue jun 16 08:30:27 -0400 2011:
>  Hello,
> 
>  I'm sending following patch which disables optimization when 
>  --enable-debug is passed. It was nasty (for me, at least) that debug 
>  build required passing of CFLAGS with -O0 to get nice traceable code.

I disagree with this change.  Debug builds are very useful to have in
production, and you don't want to be running -O0 there.  I have found
that you can use a src/Makefile.custom like this for those times when you
want to debug stuff in a particular set of files:

CFLAGS := $(patsubst -O2,-O0,$(CFLAGS))

Then you remove the .o files that you want to debug, and rerun make.
This places the burden on the developer wanting to mess with random code
changes.  Of course, this means that production builds are not as
debuggable, but IME it's much less of a problem there.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: On-the-fly index tuple deletion vs. hot_standby
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Latch implementation that wakes on postmaster death on both win32 and Unix