문제

if(iHandles[f].getInstruction() instanceof IFEQ  ) {
            getFieldInstruction = iHandles[f+1].getInstruction();
            System.out.println("found IF");
            InstructionList iprint = iFactory.createPrintln("The control is in IF");
            iList.setPositions();
            main.setMaxStack();
            main.setMaxLocals();
            main.removeLineNumbers();
            iList.insert(getFieldInstruction, iprint);
            main.setInstructionList(iList);

        }

In the above code I am instrumenting the bytecode at if statements. I'm using constants like IFEQ or IF_ICMPNE to search for an if statement in a bytecode. I want to instrument the bytecode at every method. What constants can I use to do this ? Or how is it possible?

도움이 되었습니까?

해결책

The above code works for if ... getFieldInstruction = iHandles[0].getInstruction(); to instrument methods.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top