JBoss Community

problem analyzing a stack frame

created by Luca Ferrari in Javassist - View the full discussion

Hi,

I'm trying to abalyze a simple method stack frame in order to get some informations about the status of local variables. I'm able to extract the name of the variables thru the code attribute and the constant pool as follows:

 

 

MethodInfo mInfo = method.getMethodInfo();

    CodeAttribute ca = mInfo.getCodeAttribute();

    LocalVariableAttribute lva = (LocalVariableAttribute) ca.getAttribute( LocalVariableAttribute.tag );

    ConstPool constantPool = lva.getConstPool();
    for( int i = 0; i< lva.tableLength(); i++ ){
        String currentName = constantPool.getUtf8Info( lva.nameIndex(i) );

 

but what I'd like to have is the value also of such variables at the time I analyze the method on the stack. I don't understand how I can access the stack using the local variable table to get their value, anyone can help me?

Reply to this message by going to Community

Start a new discussion in Javassist at Community