BytecodeParser
BytecodeParser copied to clipboard
Problem about DecodedLocalVariableOp.localVariable
Hi,
I'm a new user of this package. I'm now trying to retrieve the information of local variables as the sample you show on the website http://stephane.godbillon.com/BytecodeParser/.
The problem I encountered when doing this is that I cannot get the local variable for LOAD
@Override
public void handle(Op op, int idx) {
if ((op instanceof LocalVariableOpcode) == false)
return ;
LocalVariableOpcode lv = op.as(LocalVariableOpcode.class);
LocalVariable lvInfo = lv.decode(context, idx).localVariable;
System.out.println(idx + " " + lvInfo.toString() + ": " + lvInfo.name);
}
However, I got NullPointerException of lvInfo
when parsing the instruction ILOAD 5
in my program. Is it due to some wrong manipulations or restrictions?
Thanks.