Skip to main content

Extending Java stack trace with object's lifecycle

Posted by bbbbbb on December 20, 2011 at 3:10 AM PST

Summary

Article consist of extending JAVA's printStackTrace() which prints out much more details of the execution. In case of an Exception a much more detailed stack trace is printed out, from which the complete execution graph can be rebuilt. Sample code was implemented using Java instrumentation API and Java Assist API so that this functionality can be added to any Java Program at class load time without having to physically modify the sources, and by only setting a flag in the JAVA startup command.

AttachmentSize
jn-template.zip49.26 KB
offlineDebug.zip470 KB