This is the mail archive of the java-discuss@sources.redhat.com 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]

Re: weird GC problem


Jeff> Not yet.  I spent the wee hours struggling with the
Jeff> debugger... how do I get the address of a static variable?  The
Jeff> obvious didn't work.  I couldn't "print java::lang::System::in"
Jeff> or "print java.lang.System.in".  Gdb complained about "no class
Jeff> or package named `java'" or some such.

Yeah, that's annoying.

I found two ways to print it:

#1:

  p 'java::lang::System::in'

Note the quotes.

#2:

  set lang java
  p java.lang.System.in


I don't know if this is a gdb bug or not.  It does seem lame though.

Once you get past this there will be other debugger annoyances, I'm
afraid.  Feel free to file PRs with the gdb Gnats database (assuming
there is one; I haven't looked).  We haven't put as much work into the
debugger as the other tools, but we'd definitely like to keep track of
problems.

Jeff> Finalizers are a bad idea, IMO.  I don't use them anywhere in my
Jeff> code.  But there are places in libgcj we probably must have
Jeff> finalizers to be compatible with Java.

Yeah, or just for correctness.  If a FileDescriptor gets GCd we want
to make sure that the underlying OS file descriptor is freed.


As Bryce says, finalization is a bit broken still.  Really we'd like
to run them in their own thread.  But I don't think the requisite GC
support (calling a notification function when there are objects to be
finalized) is in our tree yet.

Tom

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