Patch: Code to dump serialized objects

Anthony Green green@redhat.com
Fri Nov 3 05:54:00 GMT 2000


Bryce wrote:
> Instead, I would suggest that this stuff gets activated via
> a system property (eg "gcj.dumpobjects") that can be set either by
> calling "System.setProperty()" or by using the -D option at compile-time.
>
> Even better, why not make a small utility (ala 'jcf-dump') that hooks
> into ObjectInputStream and gets installed with libgcj, ie
> 'ser-dump' or something?

Or we could build two versions of ObjectInputStream, with and without 
instrumentation.  The normal one goes in libgcj.so and the instrumented one 
goes in ser-dump.so, so under Linux at least, you just run MyProgram like 
so....

$ LD_PRELOAD=ser-dump.so MyProgram

...to get the new behaviour with zero overhead otherwise.

AG



More information about the Java-patches mailing list