This is the mail archive of the java-discuss@sourceware.cygnus.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: Debugging unhandled exceptions


>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:

Bryce> When running Java code that generates an unhandled exception in
Bryce> a Java VM, the VM prints a very convenient stack trace showing
Bryce> where the exception occured.

This is on our to-do list.  I'm not sure when it will happen exactly.

Bryce> It would be really cool if libgcj could somehow signal gdb so
Bryce> that it would stop at the location of the exception and allow
Bryce> you to get a useful backtrace, in the same way that gdb will
Bryce> stop on unhandled signals in C code.

Bryce> Any ideas on how easy/difficult this would be to implement?

I don't have any ideas about how to implement it inside gdb.  I don't
know that much about gdb.  I thought gdb had some idea of what
exception support should look like to the user, but as I recall it
doesn't work at all.

When I'm debugging Java, I often put a breakpoint on _Jv_Throw.  All
Java exceptions are thrown in this function.  This isn't automatic,
but it does work.

Tom

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