Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get stack contents in an Exception stack trace

843810Jan 17 2006 — edited Jan 17 2006
Hi

Currenty when an exception in thrown in a java class copiled with debug option we get line numbers in the stacktrace but we do not get the state of the stack.
How can I the details of the stack (i.e. values of all the local variables visible in that thread) ?
As information is available when we debug the application so I presume this information should be available but I do not know how to access it.
Obviously I would need to override this in my custom Exception as this feature is not provided by JAVA currently
I analyzed that the fillStacktrace() method is the most likely candidate but it has a native implementation in class Throwable hence was not able to get the details.

This would be a nice feature to have in future Java release
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2006
Added on Jan 17 2006
1 comment
328 views