Pregunta

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top