* [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
@ 2009-04-22 19:14 Dave Korn
2009-04-22 22:51 ` Tom Tromey
0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-04-22 19:14 UTC (permalink / raw)
To: java-patches
[ Not subbed, please CC me on replies. ]
Hello Java team,
This is the second point at which bootstrap fails for me with libgcj
debug-enabled:
In file included from /gnu/gcc/gcc/libjava/gnu/classpath/natConfiguration.cc:17:
/gnu/gcc/gcc/libjava/gnu/classpath/Configuration.h:32: error: expected
unqualified-id before numeric constant
make[3]: *** [gnu/classpath/natConfiguration.lo] Error 1
If you look at the relevant source:
21 class gnu::classpath::Configuration : public ::java::lang::Object
22 {
23
24 Configuration();
25 static ::java::lang::String * classpath_home();
26 static jboolean debug();
27 static ::java::lang::String * toolkit();
28 static ::java::lang::String * ecj();
29 public:
30 static ::java::lang::String * CLASSPATH_HOME;
31 static ::java::lang::String * CLASSPATH_VERSION;
32 static jboolean DEBUG;
... you can probably guess immediately what went wrong:
8592 static jboolean 1;
owing to a "#define DEBUG 1" in include/config.h, autogenerated by configure.
So there's a preprocessor macro DEBUG that is tested by #ifdefs in
classpath/native and the toplevel intepret*.cc files, and there are a number
of these DEBUG member vars scattered through the java sources.
One solution that occurred to me was to rename the preprocesser macro to
(e.g.) "__GCJ_DEBUG" throughout.
Another solution that occurred to me was to rename the java class members to
(e.g.) "JDEBUG" throughout.
What would the maintainers prefer? Either, both, or perhaps some other option?
cheers,
DaveK
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-22 19:14 [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap Dave Korn
@ 2009-04-22 22:51 ` Tom Tromey
2009-04-22 22:53 ` Dave Korn
2009-04-22 23:02 ` Dave Korn
0 siblings, 2 replies; 11+ messages in thread
From: Tom Tromey @ 2009-04-22 22:51 UTC (permalink / raw)
To: Dave Korn; +Cc: java-patches
>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
Dave> 32 static jboolean DEBUG;
Dave> ... you can probably guess immediately what went wrong:
Whoops.
Dave> One solution that occurred to me was to rename the
Dave> preprocesser macro to (e.g.) "__GCJ_DEBUG" throughout.
Yeah, just GCJ_DEBUG would be fine.
Dave> Another solution that occurred to me was to rename the java
Dave> class members to (e.g.) "JDEBUG" throughout.
This is more of a pain since it means putting the patch in Classpath
as well. I think it should be simpler to just change the libgcj
native code.
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-22 22:51 ` Tom Tromey
@ 2009-04-22 22:53 ` Dave Korn
2009-04-22 23:02 ` Dave Korn
1 sibling, 0 replies; 11+ messages in thread
From: Dave Korn @ 2009-04-22 22:53 UTC (permalink / raw)
To: Tom Tromey; +Cc: Dave Korn, java-patches
Tom Tromey wrote:
> Yeah, just GCJ_DEBUG would be fine.
>
> Dave> Another solution that occurred to me was to rename the java
> Dave> class members to (e.g.) "JDEBUG" throughout.
>
> This is more of a pain since it means putting the patch in Classpath
> as well. I think it should be simpler to just change the libgcj
> native code.
That's the same conclusion I came to, although for different reasons! Patch
will follow very shortly.
cheers,
DaveK
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-22 22:51 ` Tom Tromey
2009-04-22 22:53 ` Dave Korn
@ 2009-04-22 23:02 ` Dave Korn
2009-04-23 1:05 ` Tom Tromey
1 sibling, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-04-22 23:02 UTC (permalink / raw)
To: Tom Tromey; +Cc: Dave Korn, java-patches
Tom Tromey wrote:
> Dave> One solution that occurred to me was to rename the
> Dave> preprocesser macro to (e.g.) "__GCJ_DEBUG" throughout.
>
> Yeah, just GCJ_DEBUG would be fine.
Do you care about the "__" prefix? I wasn't sure if maybe it might end up
in the user's namespace (do any of the libjava/include files end up getting
installed?), so I already did it the "__GCJ_DEBUG" way; I'll respin it if it
matters.
cheers,
DaveK
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-22 23:02 ` Dave Korn
@ 2009-04-23 1:05 ` Tom Tromey
2009-04-23 2:33 ` Dave Korn
0 siblings, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2009-04-23 1:05 UTC (permalink / raw)
To: Dave Korn; +Cc: java-patches
>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
Tom> Yeah, just GCJ_DEBUG would be fine.
Dave> Do you care about the "__" prefix? I wasn't sure if maybe it
Dave> might end up in the user's namespace (do any of the
Dave> libjava/include files end up getting installed?), so I already
Dave> did it the "__GCJ_DEBUG" way; I'll respin it if it matters.
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.
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-23 1:05 ` Tom Tromey
@ 2009-04-23 2:33 ` Dave Korn
2009-04-26 0:18 ` Tom Tromey
0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-04-23 2:33 UTC (permalink / raw)
To: Tom Tromey; +Cc: Dave Korn, java-patches
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
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
[-- Attachment #2: pr38892-part-2.diff --]
[-- Type: text/x-c, Size: 11095 bytes --]
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 @@
\f
-#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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-23 2:33 ` Dave Korn
@ 2009-04-26 0:18 ` Tom Tromey
2009-04-26 1:00 ` Dave Korn
0 siblings, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2009-04-26 0:18 UTC (permalink / raw)
To: Dave Korn; +Cc: java-patches
>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
Dave> Well, as it happens :)
Dave> libjava/ChangeLog
[...]
Dave> * classpath/configure.ac: Likewise.
Dave> * classpath/native/jni/classpath/jcl.h: Likewise.
Dave> * classpath/native/jni/java-lang/java_lang_VMDouble.c: Likewise.
I think you should not need any changes to Classpath.
Classpath code won't include the CNI headers, and so should not have
the problem. Is that not the case?
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-26 0:18 ` Tom Tromey
@ 2009-04-26 1:00 ` Dave Korn
2009-04-27 12:22 ` Dave Korn
0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-04-26 1:00 UTC (permalink / raw)
To: Tom Tromey; +Cc: Dave Korn, java-patches
Tom Tromey wrote:
>>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
>
> Dave> Well, as it happens :)
> Dave> libjava/ChangeLog
>
> [...]
>
> Dave> * classpath/configure.ac: Likewise.
> Dave> * classpath/native/jni/classpath/jcl.h: Likewise.
> Dave> * classpath/native/jni/java-lang/java_lang_VMDouble.c: Likewise.
>
> I think you should not need any changes to Classpath.
> Classpath code won't include the CNI headers, and so should not have
> the problem. Is that not the case?
>
> Tom
I didn't check, I just did a mechanical search and replace; I'll try
reverting the classpath changes and check it's still ok.
cheers,
DaveK
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-26 1:00 ` Dave Korn
@ 2009-04-27 12:22 ` Dave Korn
2009-04-27 22:12 ` Tom Tromey
0 siblings, 1 reply; 11+ messages in thread
From: Dave Korn @ 2009-04-27 12:22 UTC (permalink / raw)
To: Dave Korn; +Cc: Tom Tromey, java-patches
[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]
Dave Korn wrote:
> Tom Tromey wrote:
>>>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
>> Dave> Well, as it happens :)
>> Dave> libjava/ChangeLog
>>
>> [...]
>>
>> Dave> * classpath/configure.ac: Likewise.
>> Dave> * classpath/native/jni/classpath/jcl.h: Likewise.
>> Dave> * classpath/native/jni/java-lang/java_lang_VMDouble.c: Likewise.
>>
>> I think you should not need any changes to Classpath.
>> Classpath code won't include the CNI headers, and so should not have
>> the problem. Is that not the case?
>>
>> Tom
>
> I didn't check, I just did a mechanical search and replace; I'll try
> reverting the classpath changes and check it's still ok.
How's this version? I reverted classpath/, but I left
gnu/classpath/natConfiguration.cc alone (it includes cni.h). I rebuilt the
previous $objdir rather than fully bootstrapped, but it all built fine and I
now get lots of nice debug output in my failing testruns showing me that there
are problems with the class loader, stuff like
spawn [open ...]
libgcj failure: klass->state == JV_STATE_LOADED
in function defineClass, file
/gnu/gcc/gcc/libjava/java/lang/natVMClassLoader.cc, line 99
FAIL: ExtraClassLoader execution - source compiled test
and
PASS: linking PR15133
set_ld_library_path_env_vars:
ld_library_path=.:/gnu/gcc/obj/i686-pc-cygwin/./libjava/.libs
spawn [open ...]
Exception in thread "main" java.lang.UnsatisfiedLinkError: libPR15133: No such
file or directory
at java.lang.Runtime._load(Unknown Source)
at java.lang.Runtime.loadLibrary(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at PR15133.main(Unknown Source)
FAIL: PR15133 run
UNTESTED: PR15133 output
So:
libjava/ChangeLog
* interpret.cc (DEBUG): Rename this ...
(__GCJ_DEBUG): ... to this throughout.
* configure.ac: Likewise.
* interpret-run.cc: Likewise.
* prims.cc: Likewise.
* gnu/classpath/natConfiguration.cc: Likewise.
* include/java-assert.h: Likewise.
* java/io/natVMObjectInputStream.cc: Likewise.
* configure: Regenerate.
* include/config.h.in: Regenerate.
Ok now?
cheers,
DaveK
[-- Attachment #2: pr38892-part-2-no-classpath.diff --]
[-- Type: text/x-c, Size: 5903 bytes --]
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: 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: 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: prims.cc
===================================================================
--- prims.cc (revision 146634)
+++ prims.cc (working copy)
@@ -460,7 +460,7 @@
\f
-#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: 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: 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: 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-27 12:22 ` Dave Korn
@ 2009-04-27 22:12 ` Tom Tromey
2009-04-28 4:04 ` Dave Korn
0 siblings, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2009-04-27 22:12 UTC (permalink / raw)
To: Dave Korn; +Cc: java-patches
>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
Dave> How's this version? I reverted classpath/, but I left
Dave> gnu/classpath/natConfiguration.cc alone (it includes cni.h).
Just for future reference, stuff under libjava/classpath is imported
from the Classpath project. Stuff outside of that is libgcj-specific.
So I really only meant the former, but I see now that this wasn't
clear :)
Dave> libjava/ChangeLog
Dave> * interpret.cc (DEBUG): Rename this ...
Dave> (__GCJ_DEBUG): ... to this throughout.
Dave> * configure.ac: Likewise.
Dave> * interpret-run.cc: Likewise.
Dave> * prims.cc: Likewise.
Dave> * gnu/classpath/natConfiguration.cc: Likewise.
Dave> * include/java-assert.h: Likewise.
Dave> * java/io/natVMObjectInputStream.cc: Likewise.
Dave> * configure: Regenerate.
Dave> * include/config.h.in: Regenerate.
Dave> Ok now?
Yes, thank you.
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.
2009-04-27 22:12 ` Tom Tromey
@ 2009-04-28 4:04 ` Dave Korn
0 siblings, 0 replies; 11+ messages in thread
From: Dave Korn @ 2009-04-28 4:04 UTC (permalink / raw)
To: Tom Tromey; +Cc: Dave Korn, java-patches
Tom Tromey wrote:
>>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
>
> Dave> How's this version? I reverted classpath/, but I left
> Dave> gnu/classpath/natConfiguration.cc alone (it includes cni.h).
>
> Just for future reference, stuff under libjava/classpath is imported
> from the Classpath project. Stuff outside of that is libgcj-specific.
> So I really only meant the former, but I see now that this wasn't
> clear :)
Nono.. it was pretty clear, I was just repeating back what I understood you
to mean, as confirmation.
> Dave> Ok now?
>
> Yes, thank you.
Thanks, committed.
cheers,
DaveK
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-04-28 4:04 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 19:14 [RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap Dave Korn
2009-04-22 22:51 ` Tom Tromey
2009-04-22 22:53 ` Dave Korn
2009-04-22 23:02 ` Dave Korn
2009-04-23 1:05 ` Tom Tromey
2009-04-23 2:33 ` Dave Korn
2009-04-26 0:18 ` Tom Tromey
2009-04-26 1:00 ` Dave Korn
2009-04-27 12:22 ` Dave Korn
2009-04-27 22:12 ` Tom Tromey
2009-04-28 4:04 ` Dave Korn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).