diff --git a/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java b/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java index 62252cf2bf06..4ebee5164da2 100644 --- a/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java +++ b/java/debugger/debugger-agent/src/com/intellij/rt/debugger/agent/CaptureAgent.java @@ -157,6 +157,7 @@ public class CaptureAgent { return bytes; } catch (Exception e) { + System.out.println("Capture agent: failed to instrument " + className); e.printStackTrace(); } } @@ -485,6 +486,11 @@ public class CaptureAgent { throw new IllegalStateException( "Argument with id " + myIdx + " is not available, method " + methodDisplayName + " has only " + argumentTypes.length); } + int sort = argumentTypes[myIdx].getSort(); + if (sort != Type.OBJECT && sort != Type.ARRAY) { + throw new IllegalStateException( + "Argument with id " + myIdx + " in method " + methodDisplayName + " must be an object"); + } for (int i = 0; i < myIdx; i++) { index += argumentTypes[i].getSize(); }