You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Sander Striker <st...@apache.org> on 2002/01/14 16:41:12 UTC

[PATCH] Add --enable-pool-debug to configure

Hi,

This is kind of a convenience patch.  It allows you
to specify the type of pools debugging you want at
configure time.
Any objections?

Sander

Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.398
diff -u -r1.398 configure.in
--- configure.in        13 Jan 2002 04:20:10 -0000      1.398
+++ configure.in        14 Jan 2002 15:23:58 -0000
@@ -188,6 +188,15 @@
   fi
 )dnl

+AC_ARG_ENABLE(pool-debug,
+  [  --enable-pool-debug[={yes|verbose}]],
+  [ if test -z "$enableval" -o "$enableval" = "yes"; then
+        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG)
+    elif test "$enableval" = "verbose"; then
+        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG_VERBOSE)
+    fi
+  ])
+
 dnl Electric Fence malloc checker.
 dnl --with-efence specifies the path to Electric Fence
 AC_ARG_WITH(efence,

RE: [PATCH] Add --enable-pool-debug to configure

Posted by Sander Striker <st...@apache.org>.
> From: Justin Erenkrantz [mailto:jerenkrantz@ebuilt.com]
> Subject: Re: [PATCH] Add --enable-pool-debug to configure
> 
> On Mon, Jan 14, 2002 at 11:55:48AM -0800, Roy T. Fielding wrote:
> > > +AC_ARG_ENABLE(pool-debug,
> > > +  [  --enable-pool-debug[={yes|verbose}]],
> > > +  [ if test -z "$enableval" -o "$enableval" = "yes"; then
> > > +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG)
> > > +    elif test "$enableval" = "verbose"; then
> > > +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG_VERBOSE)
> > > +    fi
> > > +  ])
> > > +
> > 
> > Why not use one APR_POOL_DEBUG symbol and give it values of 0 | 1 | 2 ???
> 
> +1.  This way we could expand or rearrange the verbosity later.
> 
> This seems as good a time as any to get it right - going to a 
> numbered system seems best in the long run.  -- justin

Ok, that sounds like a plan.
One minor nit which would be great if we could agree on:
simply defining APR_POOL_DEBUG should enable the basic debug
mode.

Eg.

$ CPPFLAGS=-DAPR_POOL_DEBUG ./configure ...

Gets you the pools code with debugging enabled

$ CPPFLAGS=-DAPR_POOL_DEBUG=0 ./configure

Same.

$ CPPFLAGS=-DAPR_POOL_DEBUG=1 ./configure

Enables debugging and verbose output.


Thoughts?

Sander

Re: [PATCH] Add --enable-pool-debug to configure

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Jan 14, 2002 at 11:55:48AM -0800, Roy T. Fielding wrote:
> > +AC_ARG_ENABLE(pool-debug,
> > +  [  --enable-pool-debug[={yes|verbose}]],
> > +  [ if test -z "$enableval" -o "$enableval" = "yes"; then
> > +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG)
> > +    elif test "$enableval" = "verbose"; then
> > +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG_VERBOSE)
> > +    fi
> > +  ])
> > +
> 
> Why not use one APR_POOL_DEBUG symbol and give it values of 0 | 1 | 2 ???

+1.  This way we could expand or rearrange the verbosity later.

This seems as good a time as any to get it right - going to a 
numbered system seems best in the long run.  -- justin


RE: [PATCH] Add --enable-pool-debug to configure

Posted by Sander Striker <st...@apache.org>.
> From: Roy T. Fielding [mailto:fielding@ebuilt.com]
> Subject: Re: [PATCH] Add --enable-pool-debug to configure
> 
> 
>> +AC_ARG_ENABLE(pool-debug,
>> +  [  --enable-pool-debug[={yes|verbose}]],
>> +  [ if test -z "$enableval" -o "$enableval" = "yes"; then
>> +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG)
>> +    elif test "$enableval" = "verbose"; then
>> +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG_VERBOSE)
>> +    fi
>> +  ])
>> +
> 
> Why not use one APR_POOL_DEBUG symbol and give it values of 0 | 1 | 2 ???
>
> .....Roy

Errr, because I hadn't considered it?
No, seriously, we started with having only APR_POOL_DEBUG and
put #if defined(APR_POOL_DEBUG) lines in the pools code.  Only
recently have we added the verbose mode.

Regular users of the debug code* are used (I think) to passing
CPPFLAGS=-DAPR_POOL_DEBUG on their commandlines to enable
the pools debugging code.
Or did people actually open the file, uncomment the define,
close the file and recompile?  And personally I like the
fact of having debug enabled, when APR_POOL_DEBUG is simply
defined.

Ofcourse we could enable verbose mode (or any other modes)
by checking the actual value of APR_POOL_DEBUG.  I'd like
to hear how the 'debug users' feel about that before moving
to that approach.

As a sidenote, the --enable-pool-debug configure option is to
enable people (who don't use the debugging code a lot and
don't have the information in their head) to get debugging
enabled in a simple fashion.  A bit like --with-efence.

Sander

 
*) The old pools debug code.  Can't speak for the new, because
   it was just added a short while back.


Re: [PATCH] Add --enable-pool-debug to configure

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> +AC_ARG_ENABLE(pool-debug,
> +  [  --enable-pool-debug[={yes|verbose}]],
> +  [ if test -z "$enableval" -o "$enableval" = "yes"; then
> +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG)
> +    elif test "$enableval" = "verbose"; then
> +        APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG_VERBOSE)
> +    fi
> +  ])
> +

Why not use one APR_POOL_DEBUG symbol and give it values of 0 | 1 | 2 ???

....Roy