• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ASM Bytecode injection and local variable creation

Posts: 1
Spring Java 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.
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic