This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[BC] Patch: FYI: make -verbose:class work
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 10 Nov 2004 11:01:18 -0700
- Subject: [BC] Patch: FYI: make -verbose:class work
- Reply-to: tromey at redhat dot com
I'm checking this in on the BC branch.
-verbose:class was a casualty of the linker rewrite on the BC branch.
This makes it work again for compiled classes. It will now
distinguish between BC and normal ABI classes in the debug output.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* link.cc (verbose_class_flag): Declare.
(wait_for_state): Print message when handling precompiled class.
* java/lang/natClass.cc (verbose_class_flag): Moved to link.cc.
Index: link.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Attic/link.cc,v
retrieving revision 1.1.2.13
diff -u -r1.1.2.13 link.cc
--- link.cc 8 Nov 2004 22:06:42 -0000 1.1.2.13
+++ link.cc 10 Nov 2004 18:01:36 -0000
@@ -40,6 +40,9 @@
using namespace gcj;
+// When true, print debugging information about class loading.
+bool gcj::verbose_class_flag;
+
typedef unsigned int uaddr __attribute__ ((mode (pointer)));
template<typename T>
@@ -1671,6 +1674,19 @@
java::lang::Thread *save = klass->thread;
klass->thread = self;
+ // Print some debugging info if requested. Interpreted classes are
+ // handled in defineclass, so we only need to handle the two
+ // pre-compiled cases here.
+ if (gcj::verbose_class_flag
+ && (klass->state == JV_STATE_COMPILED
+ || klass->state == JV_STATE_PRELOADING)
+ && ! _Jv_IsInterpretedClass (klass))
+ // We use a somewhat bogus test for the ABI here.
+ fprintf (stderr, "[Loaded (%s) %s]\n",
+ (klass->state == JV_STATE_PRELOADING ? "BC-compiled"
+ : "pre-compiled"),
+ klass->name->chars());
+
try
{
if (state >= JV_STATE_LOADING && klass->state < JV_STATE_LOADING)
Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClass.cc,v
retrieving revision 1.75.2.22
diff -u -r1.75.2.22 natClass.cc
--- java/lang/natClass.cc 8 Nov 2004 22:06:43 -0000 1.75.2.22
+++ java/lang/natClass.cc 10 Nov 2004 18:01:36 -0000
@@ -68,8 +68,6 @@
using namespace gcj;
-bool gcj::verbose_class_flag;
-
jclass
java::lang::Class::forName (jstring className, jboolean initialize,
java::lang::ClassLoader *loader)