Closed
Description
Discussed this a bit on stream before, so I'm making an issue to figure out the approach.
I generate a log with all instructions of the transformed method when the transformer fails, which makes it really easy to diagnose issues with two mods transforming the same method. This is what I used in 1.12
and older:
TraceMethodVisitor visitor = new TraceMethodVisitor(new Textifier());
for(Iterator<AbstractInsnNode> iter = method.instructions.iterator(); iter.hasNext();){
iter.next().accept(visitor);
}
// print visitor.p.getText()
with an example section of the output:
ALOAD 0
GETFIELD bud.S : Ljava/util/Random;
INVOKEVIRTUAL java/util/Random.nextFloat ()F
LDC 0.4
On stream you said Textifier
is no longer available as asm-util
is not included anymore, so I could either:
- Re-add
asm-util
and add a utility method toASMAPI
with the code above, or - Implement custom printouts for each instruction type that'd look similar to
Textifier
output, this could perhaps also include remapped names
Let me know what you think, I could PR this sometime next week.
Metadata
Metadata
Assignees
Labels
No labels