• Post Reply Bookmark Topic Watch Topic
  • New Topic

ASM Bytecode injection and local variable creation  RSS feed

Jeff Harman
Posts: 1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am struggling with a variable creation/access issue. What I am trying to do is to create a new method level local variable that will track an identifier assigned to a method to help track the entry and exit of methods for profiling and tracing. The source code is below, but what I am seeing is that the new variable falls out of scope immediately after it is used for the first time. When the exit code is generated, the reference to the new variable is no longer valid. Can someone please help me identify what I am doing wrong? The long term for this is to create an agent that can instrument a java application to allow for quick, low impact determination of resource hogs.

Class that inserts the bytecode:

Class Visitor:



Class that contains the static calls:

Thanks for any help,

Insanity: Doing the same thing over and over again and expecting the same results in a multithreaded application.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!