On Sat, 2005-06-25 at 15:51 +0200, Mark Wielaard wrote: > Hi, > > While working with the native gtk+ awt peers I often need to find out > where precisely a warning or error message is comming from. The > following patch installs a default log handler that dumps a stacktrace > whenever we encounter such a situation. It is careful about only > installing it when gtk+ (> 2.4) supports it and that it isn't swallowing > any pending exceptions. > > 2005-06-25 Mark Wielaard <[EMAIL PROTECTED]> > > * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c > (glog_func): New static function. > (Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Install glog_func as > default log handler. > * native/jni/gtk-peer/Makefile.am (libgtkpeer_la_LIBADD): Add jcl. > > This generates things like: > > java.lang.InternalError: GdkPixbuf: gdk_pixbuf_loader_close: assertion > `priv->closed == FALSE' failed > at gnu.java.awt.peer.gtk.GdkPixbufDecoder.finish (Native Method) > at gnu.java.awt.peer.gtk.GdkPixbufDecoder.finalize > (GdkPixbufDecoder.java:182) > > (Which indeed is a bug that I recently introduces, sorry. We should be > more careful in the finalizer manipulating the native state.) > > The stack trace generation is only conditional on it being something > that already generates output on stderr by default. Since I think that > none of these error/warning messages should ever occur in our code (it > means we are feeding the native side bogus data from java-'user-space') > I think this is the right thing to do. And it really helps with > debugging. > > Comments?
This looks good. Thanks! Tom > > Cheers, > > Mark > _______________________________________________ > Classpath-patches mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/classpath-patches _______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
