2007年5月17日星期四

Euxx: Show me the variables

In "Show me the variables," Euxx shows how to add variables to classes modified by aspect-oriented weaving libraries, by creating debugging information about new variables, so the debugger can match it with the actual state and even if those variables are not in the source code, the user will see them in the debugger.
Bytecode waving is a powerful technique that gained popularity in a last few years. Well known tools are using it with great success, that include Hibernate, CGLIB, AspectWerkz, AspectJ, you name it...

Unfortunately, in many cases these tools introduce additional challenge to developers who need to debug an instrumented code. Waving adds an additional behavior that is not shown in the source code and it may also add additional state that is hard to trace, especially if it is stored in method variables. To solve this, instrumentation could add a debug logging, but it would be additional overhead on the bytecode size, instrumentation and runtime performance. However, with very little effort waving tools could make debugging of the instrumented methods with new variables much easier.

没有评论: