Commit 6ee44dd
Allow pre-Java 6 classes to be transformed in the debugger (#9591)
Allow pre-Java 6 classes to be transformed in the debugger
Pre-Java 6 classes can contain JSR/RET instructions which are not
supported by ASM when the COMPUTE_FRAMES is used. This leads to
exceptions like this:
13:34:29.407 [Test worker] ERROR com.datadog.debugger.agent.DebuggerTransformer - Cannot write classfile for class: org.apache.felix.gogo.runtime.Pipe Exception:
java.lang.IllegalArgumentException: JSR/RET are not supported with computeFrames option
at org.objectweb.asm.Frame.execute(Frame.java:1028)
at org.objectweb.asm.MethodWriter.visitJumpInsn(MethodWriter.java:1147)
at org.objectweb.asm.tree.JumpInsnNode.accept(JumpInsnNode.java:79)
at org.objectweb.asm.tree.InsnList.accept(InsnList.java:144)
at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:749)
at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:647)
at org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:468)
at com.datadog.debugger.agent.DebuggerTransformer.writeClassFile(DebuggerTransformer.java:492)
...
This uses ASM's JSRInlinerAdapter to rewrite the problematic JSR/RET
instructions as the class file is written.
---------
Co-authored-by: DJ Gregor <[email protected]>1 parent aadd471 commit 6ee44dd
File tree
2 files changed
+43
-1
lines changed- dd-java-agent/agent-debugger/src
- main/java/com/datadog/debugger/agent
- test/java/com/datadog/debugger/agent
2 files changed
+43
-1
lines changedLines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
| 64 | + | |
63 | 65 | | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
487 | 490 | | |
488 | 491 | | |
489 | 492 | | |
| 493 | + | |
490 | 494 | | |
491 | 495 | | |
492 | | - | |
| 496 | + | |
493 | 497 | | |
494 | 498 | | |
495 | 499 | | |
| |||
929 | 933 | | |
930 | 934 | | |
931 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
932 | 956 | | |
933 | 957 | | |
934 | 958 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
278 | 296 | | |
279 | 297 | | |
280 | 298 | | |
| |||
0 commit comments