I am instrumenting some classes and introducing some new local variables. Now, when the user places a breakpoint in the code, and execution is stopped, the newly introduced local variables can be seen inside Intellij IDEA's debugger window. How can I hide them?
UPDATE: I will have to somehow remove debug info from the instrumented code, but not sure how to do it.
UPDATE 2: I am using the ASM library for instrumentation.
public void visitCode() {
this.mv.visitLdcInsn(stringToPass);
this.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "MyAgentClass", "loadData", "(Ljava/lang/String;)LDataClass;", false);
this.mv.visitVarInsn(Opcodes.ASTORE, this.getDataIndex());
}
public void visitMaxs(int maxStack, int maxLocals) {
if (this.myStartLabel != null && this.myEndLabel != null) {
this.mv.visitLocalVariable("__my__data__", "Ljava/lang/Object;", (String) null, this.myStartLabel, this.myEndLabel, this.getDataIndex());
}
super.visitMaxs(maxStack, maxLocals);
}
__my__data__
is shown inside Intellij IDEA.