[Pcre-svn] [257] code/trunk: Implement --enable-debug.

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [257] code/trunk: Implement --enable-debug.
Revision: 257
          http://www.exim.org/viewvc/pcre2?view=rev&revision=257
Author:   ph10
Date:     2015-04-24 12:14:47 +0100 (Fri, 24 Apr 2015)


Log Message:
-----------
Implement --enable-debug.

Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/README
    code/trunk/config-cmake.h.in
    code/trunk/configure.ac
    code/trunk/doc/pcre2build.3
    code/trunk/maint/ManyConfigTests
    code/trunk/src/pcre2_jit_compile.c


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/CMakeLists.txt    2015-04-24 11:14:47 UTC (rev 257)
@@ -67,6 +67,7 @@
 # 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
 # 2013-11-05 PH added support for PARENS_NEST_LIMIT
 # 2014-08-29 PH converted the file for PCRE2 (which has no C++).
+# 2015-04024 PH added support for PCRE2_DEBUG


PROJECT(PCRE2 C)

@@ -118,6 +119,8 @@

OPTION(PCRE2_BUILD_PCRE2_32 "Build 32 bit PCRE2 library" OFF)

+OPTION(PCRE2_DEBUG "Include debugging code" OFF)
+
 SET(PCRE2_EBCDIC OFF CACHE BOOL
     "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems.)")



Modified: code/trunk/README
===================================================================
--- code/trunk/README    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/README    2015-04-24 11:14:47 UTC (rev 257)
@@ -293,6 +293,9 @@
   both EBCDIC and UTF-8/16/32. There is a second option, --enable-ebcdic-nl25,
   which specifies that the code value for the EBCDIC NL character is 0x25
   instead of the default 0x15.
+  
+. If you specify --enable-debug, additional debugging code is included in the
+  build. This option is intended for use by the PCRE2 maintainers. 


. In environments where valgrind is installed, if you specify

@@ -829,4 +832,4 @@
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
-Last updated: 26 January 2015
+Last updated: 24 April 2015

Modified: code/trunk/config-cmake.h.in
===================================================================
--- code/trunk/config-cmake.h.in    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/config-cmake.h.in    2015-04-24 11:14:47 UTC (rev 257)
@@ -17,6 +17,7 @@
 #cmakedefine SUPPORT_PCRE2_8 1
 #cmakedefine SUPPORT_PCRE2_16 1
 #cmakedefine SUPPORT_PCRE2_32 1
+#cmakedefine PCRE2_DEBUG 1


#cmakedefine SUPPORT_LIBBZ2 1
#cmakedefine SUPPORT_LIBEDIT 1

Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/configure.ac    2015-04-24 11:14:47 UTC (rev 257)
@@ -130,12 +130,18 @@
               , enable_pcre2_32=unset)
 AC_SUBST(enable_pcre2_32)


+# Handle --dnable-debug (disabled by default)
+AC_ARG_ENABLE(debug,
+              AS_HELP_STRING([--enable-debug],
+                             [enable debugging code]),
+              , enable_debug=no)                 
+
 # Handle --enable-jit (disabled by default)
 AC_ARG_ENABLE(jit,
               AS_HELP_STRING([--enable-jit],
                              [enable Just-In-Time compiling support]),
               , enable_jit=no)
-
+              
 # Handle --disable-pcre2grep-jit (enabled by default)
 AC_ARG_ENABLE(pcre2grep-jit,
               AS_HELP_STRING([--disable-pcre2grep-jit],
@@ -381,6 +387,7 @@
 AM_CONDITIONAL(WITH_PCRE2_8, test "x$enable_pcre2_8" = "xyes")
 AM_CONDITIONAL(WITH_PCRE2_16, test "x$enable_pcre2_16" = "xyes")
 AM_CONDITIONAL(WITH_PCRE2_32, test "x$enable_pcre2_32" = "xyes")
+AM_CONDITIONAL(WITH_DEBUG, test "x$enable_debug" = "xyes")
 AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
 AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
 AM_CONDITIONAL(WITH_UNICODE, test "x$enable_unicode" = "xyes")
@@ -504,6 +511,11 @@
     Define to any value to enable the 32 bit PCRE2 library.])
 fi


+if test "$enable_debug" = "yes"; then
+  AC_DEFINE([PCRE2_DEBUG], [], [
+    Define to any value to include debugging code.])
+fi      
+
 # Unless running under Windows, JIT support requires pthreads.


 if test "$enable_jit" = "yes"; then
@@ -864,6 +876,7 @@
     Build 8-bit pcre2 library ....... : ${enable_pcre2_8}
     Build 16-bit pcre2 library ...... : ${enable_pcre2_16}
     Build 32-bit pcre2 library ...... : ${enable_pcre2_32}
+    Include debugging code .......... : ${enable_debug} 
     Enable JIT compiling support .... : ${enable_jit}
     Enable Unicode support .......... : ${enable_unicode}
     Newline char/sequence ........... : ${enable_newline}


Modified: code/trunk/doc/pcre2build.3
===================================================================
--- code/trunk/doc/pcre2build.3    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/doc/pcre2build.3    2015-04-24 11:14:47 UTC (rev 257)
@@ -1,4 +1,4 @@
-.TH PCRE2BUILD 3 "13 April 2015" "PCRE2 10.20"
+.TH PCRE2BUILD 3 "23 April 2015" "PCRE2 10.20"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .
@@ -410,6 +410,17 @@
 immediately before the \fBconfigure\fP command.
 .
 .
+.SH "INCLUDING DEBUGGING CODE"
+.rs
+.sp
+If you add
+.sp
+  --enable-debug
+.sp
+to the \fBconfigure\fP command, additional debugging code is included in the 
+build. This feature is intended for use by the PCRE2 maintainers.   
+.
+.
 .SH "DEBUGGING WITH VALGRIND SUPPORT"
 .rs
 .sp
@@ -499,6 +510,6 @@
 .rs
 .sp
 .nf
-Last updated: 13 April 2015
+Last updated: 24 April 2015
 Copyright (c) 1997-2015 University of Cambridge.
 .fi


Modified: code/trunk/maint/ManyConfigTests
===================================================================
--- code/trunk/maint/ManyConfigTests    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/maint/ManyConfigTests    2015-04-24 11:14:47 UTC (rev 257)
@@ -184,7 +184,7 @@
 # Update the total count whenever a new test is added; it is used to show
 # progess as each test is run.


-testtotal=`expr 20 \* $usemain + \
+testtotal=`expr 21 \* $usemain + \
1 \* $usetmp + \
1 \* $ISGCC \* $usemain + \
1 \* $ISGCC \* $usemain \* $useasan + \
@@ -239,6 +239,10 @@
echo "CFLAGS=$CFLAGS"

 if [ $usemain -ne 0 ]; then
+  echo "---------- Maximally configured test with --enable-debug ----------"
+  opts="--disable-shared $enable_jit --enable-pcre2-16 --enable-pcre2-32 --enable-debug"
+  runtest
+
   echo "---------- Non-JIT tests in the current directory ----------"
   for opts in \
     "" \


Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2015-04-23 17:38:02 UTC (rev 256)
+++ code/trunk/src/pcre2_jit_compile.c    2015-04-24 11:14:47 UTC (rev 257)
@@ -54,7 +54,12 @@
 #define SLJIT_CONFIG_AUTO 1
 #define SLJIT_CONFIG_STATIC 1
 #define SLJIT_VERBOSE 0
+
+#ifdef PCRE2_DEBUG
+#define SLJIT_DEBUG 1
+#else
 #define SLJIT_DEBUG 0
+#endif


#define SLJIT_MALLOC(size, allocator_data) pcre2_jit_malloc(size, allocator_data)
#define SLJIT_FREE(ptr, allocator_data) pcre2_jit_free(ptr, allocator_data)