This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.


Tom Tromey wrote:

> A couple of the headers are installed, but this symbol isn't used by
> any of them.  So, without the underscores is ok.  It doesn't matter
> hugely to me, though, so if you already have the patch, the underscore
> variant is fine too.

  Well, as it happens :)

libjava/ChangeLog

	* interpret.cc (DEBUG):  Rename this ...
	(__GCJ_DEBUG):  ... to this throughout.
	* interpret-run.cc:  Likewise.
	* prims.cc:  Likewise.
	* configure.ac:  Likewise.
	* classpath/configure.ac:  Likewise.
	* classpath/native/jni/classpath/jcl.h:  Likewise.
	* classpath/native/jni/java-lang/java_lang_VMDouble.c:  Likewise.
	* classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c:
	Likewise.
	* classpath/native/jni/java-math/gnu_java_math_GMP.c:  Likewise.
	* classpath/native/fdlibm/mprec.c:  Likewise.
	* classpath/native/fdlibm/mprec.h:  Likewise.
	* classpath/native/fdlibm/dtoa.c:  Likewise.
	* gnu/classpath/natConfiguration.cc:  Likewise.
	* include/java-assert.h:  Likewise.
	* java/io/natVMObjectInputStream.cc:  Likewise.
	* configure:  Regenerate.
	* classpath/configure:  Regenerate.
	* include/config.h.in:  Regenerate.
	* classpath/include/config.h.in:  Regenerate.

  Tested by seeing bootstrap run to completion on i686-pc-cygwin, and then
seeing lots of debug output from the run of gcj-dbtool to generate
classmap.db.  Ok?

    cheers,
      DaveK
Index: interpret.cc
===================================================================
--- interpret.cc	(revision 146634)
+++ interpret.cc	(working copy)
@@ -983,7 +983,7 @@
 _Jv_InterpMethod::run (void *retp, INTERP_FFI_RAW_TYPE *args,
 		       _Jv_InterpMethod *meth)
 {
-#undef DEBUG
+#undef __GCJ_DEBUG
 #undef DEBUG_LOCALS_INSN
 #define DEBUG_LOCALS_INSN(s, t) do {} while (0)
 
@@ -994,7 +994,7 @@
 _Jv_InterpMethod::run_debug (void *retp, INTERP_FFI_RAW_TYPE *args,
 			     _Jv_InterpMethod *meth)
 {
-#define DEBUG
+#define __GCJ_DEBUG
 #undef DEBUG_LOCALS_INSN
 #define DEBUG_LOCALS_INSN(s, t)  \
   do    \
@@ -1719,7 +1719,7 @@
    CATCH_LOCATION with the method and location where the catch will
    occur. If the exception is not caught, these are set to 0.
 
-   This function should only be used with the DEBUG interpreter. */
+   This function should only be used with the __GCJ_DEBUG interpreter. */
 static void
 find_catch_location (::java::lang::Throwable *exc, jthread thread,
 		     jmethodID *catch_method, jlong *catch_loc)
@@ -1751,7 +1751,7 @@
    caught (if it is caught).
    
    Like find_catch_location, this should only be called with the
-   DEBUG interpreter. Since a few exceptions occur outside the
+   __GCJ_DEBUG interpreter. Since a few exceptions occur outside the
    interpreter proper, it is important to not call this function
    without checking JVMTI_REQUESTED_EVENT(Exception) first. */
 void
Index: interpret-run.cc
===================================================================
--- interpret-run.cc	(revision 146634)
+++ interpret-run.cc	(working copy)
@@ -23,7 +23,7 @@
   // returns.
   java::lang::Thread *thread = java::lang::Thread::currentThread();
   
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   _Jv_InterpFrame frame_desc (meth, thread, NULL, &pc);
 #else
   _Jv_InterpFrame frame_desc (meth, thread);
@@ -38,7 +38,7 @@
 
   _Jv_word locals[meth->max_locals];
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   // This is the information needed to get and set local variables with
   // proper type checking.
   frame_desc.locals = locals;
@@ -126,7 +126,7 @@
           continue;
         }
     }
-#endif /* DEBUG */
+#endif /* __GCJ_DEBUG */
 
 #define INSN_LABEL(op) &&insn_##op
 
@@ -347,7 +347,7 @@
 
 #ifdef DIRECT_THREADED
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #undef NEXT_INSN
 #define NEXT_INSN							\
   do									\
@@ -392,7 +392,7 @@
 
 #undef INTERP_REPORT_EXCEPTION
 #define INTERP_REPORT_EXCEPTION(Jthrowable) REPORT_EXCEPTION (Jthrowable)
-#else // !DEBUG
+#else // !__GCJ_DEBUG
 #undef NEXT_INSN
 #define NEXT_INSN goto *((pc++)->insn)
 
@@ -416,7 +416,7 @@
 
 #undef INTERP_REPORT_EXCEPTION
 #define INTERP_REPORT_EXCEPTION(Jthrowable) /* not needed when not debugging */
-#endif // !DEBUG
+#endif // !__GCJ_DEBUG
 
 #define INTVAL() ((pc++)->int_val)
 #define AVAL() ((pc++)->datum)
@@ -450,7 +450,7 @@
 
 #else
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #define NEXT_INSN							\
   do									\
     {									\
@@ -2677,7 +2677,7 @@
         {
           sp = stack;
           sp++->o = ex; // Push exception.
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
           if (JVMTI_REQUESTED_EVENT (ExceptionCatch))
             {
               using namespace gnu::gcj::jvmti;
Index: prims.cc
===================================================================
--- prims.cc	(revision 146634)
+++ prims.cc	(working copy)
@@ -460,7 +460,7 @@
 
 
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 void
 _Jv_Abort (const char *function, const char *file, int line,
 	   const char *message)
@@ -469,7 +469,7 @@
 _Jv_Abort (const char *, const char *, int, const char *message)
 #endif
 {
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   fprintf (stderr,
 	   "libgcj failure: %s\n   in function %s, file %s, line %d\n",
 	   message, function, file, line);
Index: configure.ac
===================================================================
--- configure.ac	(revision 146634)
+++ configure.ac	(working copy)
@@ -244,7 +244,7 @@
   AS_HELP_STRING([--enable-libgcj-debug],
                  [enable runtime debugging code]),
   [if test "$enable_libgcj_debug" = yes; then
-    AC_DEFINE(DEBUG, 1, [Define this if you want runtime debugging enabled.])
+    AC_DEFINE(__GCJ_DEBUG, 1, [Define this if you want runtime debugging enabled.])
     LIBGCJDEBUG="enable"
   fi])
 
Index: classpath/configure.ac
===================================================================
--- classpath/configure.ac	(revision 146634)
+++ classpath/configure.ac	(working copy)
@@ -877,7 +877,7 @@
               [case "${enableval}" in 
                 yes) 
               	LIBDEBUG="true"
-                AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled]) 
+                AC_DEFINE(__GCJ_DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled]) 
               	;;
                 no)   LIBDEBUG="false" ;;
                 *) 	AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
Index: classpath/native/jni/classpath/jcl.h
===================================================================
--- classpath/native/jni/classpath/jcl.h	(revision 146634)
+++ classpath/native/jni/classpath/jcl.h	(working copy)
@@ -74,7 +74,7 @@
 #define JCL_RETHROW_EXCEPTION(env) if((*(env))->ExceptionOccurred((env)) != NULL) return NULL;
 
 /* Simple debug macro */
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #define DBG(x) fprintf(stderr, "%s", (x));
 #else
 #define DBG(x)
Index: classpath/native/jni/java-lang/java_lang_VMDouble.c
===================================================================
--- classpath/native/jni/java-lang/java_lang_VMDouble.c	(revision 146634)
+++ classpath/native/jni/java-lang/java_lang_VMDouble.c	(working copy)
@@ -101,7 +101,7 @@
   NEGATIVE_INFINITY = (*env)->GetStaticDoubleField (env, clsDouble, negInfID);
   NaN = (*env)->GetStaticDoubleField (env, clsDouble, nanID);
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   fprintf (stderr, "java.lang.Double.initIDs() POSITIVE_INFINITY = %g\n",
 	   POSITIVE_INFINITY);
   fprintf (stderr, "java.lang.Double.initIDs() NEGATIVE_INFINITY = %g\n",
@@ -169,7 +169,7 @@
   const char *p = buf, *end, *last_non_ws, *temp;
   int ok = 1;
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
 #endif
 
@@ -224,7 +224,7 @@
 
       val = _strtod_r (&reent, p, &endptr);
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
       fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
       fprintf (stderr, "java.lang.VMDouble.parseDouble %p != %p ???\n",
 	       endptr, last_non_ws);
Index: classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c
===================================================================
--- classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c	(revision 146634)
+++ classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c	(working copy)
@@ -46,7 +46,7 @@
 #include <stddef.h>
 #include "local.h"
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #define TRACE(msg) fprintf (stderr, "%s(%s:%d) -- %s\n", __FUNCTION__, __FILE__, __LINE__, msg)
 #else
 #define TRACE(msg)
Index: classpath/native/jni/java-math/gnu_java_math_GMP.c
===================================================================
--- classpath/native/jni/java-math/gnu_java_math_GMP.c	(revision 146634)
+++ classpath/native/jni/java-math/gnu_java_math_GMP.c	(working copy)
@@ -85,7 +85,7 @@
 
 static jfieldID native_ptr;
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #define TRACE(msg) fprintf (stderr, "%s(%s:%d) -- %s\n", __FUNCTION__, __FILE__, __LINE__, msg)
 #else
 #define TRACE(msg)
Index: classpath/native/fdlibm/mprec.c
===================================================================
--- classpath/native/fdlibm/mprec.c	(revision 146634)
+++ classpath/native/fdlibm/mprec.c	(working copy)
@@ -556,7 +556,7 @@
 
   i = a->_wds;
   j = b->_wds;
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   if (i > 1 && !a->_x[i - 1])
     Bug ("cmp called with a->_x[a->_wds-1] == 0");
   if (j > 1 && !b->_x[j - 1])
@@ -725,7 +725,7 @@
   xa0 = a->_x;
   xa = xa0 + a->_wds;
   y = *--xa;
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   if (!y)
     Bug ("zero y in b2d");
 #endif
@@ -847,7 +847,7 @@
   else
 #endif
     {
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
       if (!z)
 	Bug ("Zero passed to d2b");
 #endif
@@ -890,7 +890,7 @@
     }
   else
     {
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
       if (!z)
 	Bug ("Zero passed to d2b");
 #endif
Index: classpath/native/fdlibm/mprec.h
===================================================================
--- classpath/native/fdlibm/mprec.h	(revision 146634)
+++ classpath/native/fdlibm/mprec.h	(working copy)
@@ -61,7 +61,7 @@
 #define Just_16
 #endif
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #include "stdio.h"
 #include <stdlib.h>
 #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
Index: classpath/native/fdlibm/dtoa.c
===================================================================
--- classpath/native/fdlibm/dtoa.c	(revision 146634)
+++ classpath/native/fdlibm/dtoa.c	(working copy)
@@ -46,7 +46,7 @@
 #endif
 
   n = S->_wds;
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   /*debug*/ if (b->_wds > n)
     /*debug*/ Bug ("oversize b in quorem");
 #endif
@@ -57,7 +57,7 @@
   bx = b->_x;
   bxe = bx + n;
   q = *bxe / (*sxe + 1);	/* ensure q <= true quotient */
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   /*debug*/ if (q > 9)
     /*debug*/ Bug ("oversized quotient in quorem");
 #endif
@@ -140,7 +140,7 @@
   return q;
 }
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #include <stdio.h>
 
 void
Index: gnu/classpath/natConfiguration.cc
===================================================================
--- gnu/classpath/natConfiguration.cc	(revision 146634)
+++ gnu/classpath/natConfiguration.cc	(working copy)
@@ -25,7 +25,7 @@
 jboolean
 gnu::classpath::Configuration::debug()
 {
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
   return true;
 #else
   return false;
Index: include/java-assert.h
===================================================================
--- include/java-assert.h	(revision 146634)
+++ include/java-assert.h	(working copy)
@@ -16,7 +16,7 @@
 void _Jv_Abort (const char *, const char *, int, const char *)
   __attribute__ ((__noreturn__));
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #define _Jv_AssertDoCall(Message) _Jv_Abort (__FUNCTION__, __FILE__, __LINE__, Message)
 
 #define JvAssertMessage(Expr, Message) \
@@ -26,13 +26,13 @@
 
 #define JvFail(Message) _Jv_AssertDoCall (Message)
 
-#else /* DEBUG */
+#else /* __GCJ_DEBUG */
 
 #define _Jv_AssertDoCall(Message)
 #define JvAssertMessage(Expr, Message)
 #define JvAssert(Expr)
 #define JvFail(Message) _Jv_Abort (0, 0, 0, Message)
 
-#endif /* not DEBUG */
+#endif /* not __GCJ_DEBUG */
 
 #endif /* __JAVA_ASSERT_H__ */
Index: java/io/natVMObjectInputStream.cc
===================================================================
--- java/io/natVMObjectInputStream.cc	(revision 146634)
+++ java/io/natVMObjectInputStream.cc	(working copy)
@@ -26,7 +26,7 @@
 #include <java/lang/reflect/Method.h>
 #include <java-stack.h>
 
-#ifdef DEBUG
+#ifdef __GCJ_DEBUG
 #include <java/lang/System.h>
 #include <java/io/PrintStream.h>
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]