2

I'd like to write a generic exception handler that would report not only the exception and stacktrace, but also function arguments for all the functions in the stacktrace. If it would be possible for locals and this object as well, it would be just awesome. I'm thinking of writing my own some-kind-of poor man's Takipi. How could I achieve this?

mik01aj
  • 11,928
  • 15
  • 76
  • 119
  • In [Takipi docs](http://support.takipi.com/performance-overhead/) they say that Takipi is written in C++, so they might do stuff that's impossible with plain Java. But my question remains open :) – mik01aj Nov 25 '14 at 12:15

1 Answers1

1

One way would be to use the Java Debug Interface to capture function arguments, this, and locals for all the functions in the stacktrace. It requires launching the JVM with the debugger on.

Otherwise, you could use instrumentation agents to modify the byte codes of methods to capture the information for use in your exception handler.

Community
  • 1
  • 1
jmehrens
  • 10,580
  • 1
  • 38
  • 47