a minor build patch to facilitate debugging

Vladimir Shebordaev vshebordaev at mail.ru
Mon Jul 30 22:31:54 UTC 2012


2012/7/31 Maxim Dounin <mdounin at mdounin.ru>:
> Hello!
>
> On Mon, Jul 30, 2012 at 10:26:27PM +0400, Vladimir Shebordaev wrote:
>
>> Hi,
>>
>> I think it would be nice to disable optimitazions and enable full
>> debugging options when NGX_DEBUG is set
>
> These are quite orthogonal things.  The --with-debug option
> enables debug logging.  It's up to you to disable optimizations if
> you wan't to (--with-cc-opt="-O0") and/or enable additional
> debugging flags as understood by your compiler and debugger, but
> certainly not something should be done by default due to --with-debug.
>
>>
>> diff -Naur rev4754/auto/cc/gcc ticket55/auto/cc/gcc
>> --- rev4754/auto/cc/gcc 2012-07-16 23:15:16.733977245 +0400
>> +++ ticket55/auto/cc/gcc        2012-07-23 08:50:14.420222679 +0400
>> @@ -50,7 +50,12 @@
>>
>>  #NGX_GCC_OPT="-O2"
>>  #NGX_GCC_OPT="-Os"
>> +if [ "$NGX_DEBUG" = YES ]; then
>
> This is a wrong test for sure, as NGX_DEBUG is never empty, it's
> either NO or YES.
>

Sure, sorry, it is an excerpt from my working tree where I set the
flag on make command line. But when you enable debugging in the server
you might want to also run it under the debugger. It seems useful
anyways. At least for gcc.

>> +NGX_GCC_OPT="-ggdb3"
>> +else
>>  NGX_GCC_OPT="-O"
>> +fi
>> +
>>
>>  #CFLAGS="$CFLAGS -fomit-frame-pointer"
>
> Maxim Dounin
>



More information about the nginx-devel mailing list