oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.26k stars 1.62k forks source link

Debug. Intellij IDEA(Webstorm etc.) Breakpoint exceptions #1763

Closed smokeelow closed 4 years ago

smokeelow commented 4 years ago

When i attaching debugger in Intellij IDEA and trying to set breakpoint -> on server side (Graal VM) throws following exceptions.

java.lang.Exception: Event onExecute failed for instrument class com.oracle.truffle.api.debug.impl.DebuggerInstrument and listener/factory com.oracle.truffle.api.debug.Breakpoint$1@1d686056. at com.oracle.truffle.api.instrumentation.ProbeNode.exceptionEventForClientInstrument(ProbeNode.java:650) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.notifySourceExecutedBinding(InstrumentationHandler.java:895) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.addSourceExecutionBinding(InstrumentationHandler.java:536) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.attachExecuteSourceListener(InstrumentationHandler.java:1044) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.access$2100(InstrumentationHandler.java:92) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractInstrumenter.attachExecuteSourceListener(InstrumentationHandler.java:1944) at com.oracle.truffle.api.debug.Breakpoint.install(Breakpoint.java:536) at com.oracle.truffle.api.debug.Breakpoint.install(Breakpoint.java:526) at com.oracle.truffle.api.debug.DebuggerSession.install(DebuggerSession.java:733) at com.oracle.truffle.api.debug.DebuggerSession.install(DebuggerSession.java:721) at com.oracle.truffle.tools.chromeinspector.BreakpointsHandler.lambda$createURLBreakpoint$0(BreakpointsHandler.java:91) at com.oracle.truffle.tools.chromeinspector.ScriptsHandler.addLoadScriptListener(ScriptsHandler.java:91) at com.oracle.truffle.tools.chromeinspector.BreakpointsHandler.createURLBreakpoint(BreakpointsHandler.java:104) at com.oracle.truffle.tools.chromeinspector.InspectorDebugger.setBreakpointByUrl(InspectorDebugger.java:493) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.doProcessCommand(InspectServerSession.java:390) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.processCommand(InspectServerSession.java:249) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.access$300(InspectServerSession.java:61) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession$CommandProcessThread.run(InspectServerSession.java:576) Caused by: java.lang.ClassCastException: com.oracle.truffle.js.nodes.JavaScriptNodeWrapper cannot be cast to com.oracle.truffle.js.nodes.function.FunctionRootNode at com.oracle.truffle.js.nodes.function.FunctionBodyNode.materializeInstrumentableNodes(FunctionBodyNode.java:85) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.materializeSyntaxNodes(InstrumentationHandler.java:1353) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1312) at com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:468) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1337) at com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:468) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1337) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitRoot(InstrumentationHandler.java:1169) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitRoots(InstrumentationHandler.java:718) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitLoadedSourceSections(InstrumentationHandler.java:478) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitLoadedSourceSections(InstrumentationHandler.java:1040) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.access$2000(InstrumentationHandler.java:92) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractInstrumenter.visitLoadedSourceSections(InstrumentationHandler.java:1938) at com.oracle.truffle.api.debug.SuspendableLocationFinder.findNearestBound(SuspendableLocationFinder.java:114) at com.oracle.truffle.api.debug.SuspendableLocationFinder.findNearest(SuspendableLocationFinder.java:92) at com.oracle.truffle.api.debug.BreakpointLocation$BreakpointSourceLocation.adjustLocation(BreakpointLocation.java:183) at com.oracle.truffle.api.debug.Breakpoint$1.onExecute(Breakpoint.java:548) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.notifySourceExecutedBinding(InstrumentationHandler.java:890) ... 16 more java.lang.Exception: Event onExecute failed for instrument class com.oracle.truffle.api.debug.impl.DebuggerInstrument and listener/factory com.oracle.truffle.api.debug.Breakpoint$1@7d479f19. at com.oracle.truffle.api.instrumentation.ProbeNode.exceptionEventForClientInstrument(ProbeNode.java:650) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.notifySourceExecutedBinding(InstrumentationHandler.java:895) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.addSourceExecutionBinding(InstrumentationHandler.java:536) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.attachExecuteSourceListener(InstrumentationHandler.java:1044) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.access$2100(InstrumentationHandler.java:92) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractInstrumenter.attachExecuteSourceListener(InstrumentationHandler.java:1944) at com.oracle.truffle.api.debug.Breakpoint.install(Breakpoint.java:536) at com.oracle.truffle.api.debug.Breakpoint.install(Breakpoint.java:526) at com.oracle.truffle.api.debug.DebuggerSession.install(DebuggerSession.java:733) at com.oracle.truffle.api.debug.DebuggerSession.install(DebuggerSession.java:721) at com.oracle.truffle.tools.chromeinspector.BreakpointsHandler.lambda$createURLBreakpoint$0(BreakpointsHandler.java:91) at com.oracle.truffle.tools.chromeinspector.ScriptsHandler.addLoadScriptListener(ScriptsHandler.java:91) at com.oracle.truffle.tools.chromeinspector.BreakpointsHandler.createURLBreakpoint(BreakpointsHandler.java:104) at com.oracle.truffle.tools.chromeinspector.InspectorDebugger.setBreakpointByUrl(InspectorDebugger.java:493) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.doProcessCommand(InspectServerSession.java:390) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.processCommand(InspectServerSession.java:249) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession.access$300(InspectServerSession.java:61) at com.oracle.truffle.tools.chromeinspector.server.InspectServerSession$CommandProcessThread.run(InspectServerSession.java:576) Caused by: java.lang.ClassCastException: com.oracle.truffle.js.nodes.JavaScriptNodeWrapper cannot be cast to com.oracle.truffle.js.nodes.function.FunctionRootNode at com.oracle.truffle.js.nodes.function.FunctionBodyNode.materializeInstrumentableNodes(FunctionBodyNode.java:85) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.materializeSyntaxNodes(InstrumentationHandler.java:1353) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1312) at com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:468) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1337) at com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:468) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractNodeVisitor.visit(InstrumentationHandler.java:1337) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitRoot(InstrumentationHandler.java:1169) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitRoots(InstrumentationHandler.java:718) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitLoadedSourceSections(InstrumentationHandler.java:478) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitLoadedSourceSections(InstrumentationHandler.java:1040) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.access$2000(InstrumentationHandler.java:92) at com.oracle.truffle.api.instrumentation.InstrumentationHandler$AbstractInstrumenter.visitLoadedSourceSections(InstrumentationHandler.java:1938) at com.oracle.truffle.api.debug.SuspendableLocationFinder.findNearestBound(SuspendableLocationFinder.java:114) at com.oracle.truffle.api.debug.SuspendableLocationFinder.findNearest(SuspendableLocationFinder.java:92) at com.oracle.truffle.api.debug.BreakpointLocation$BreakpointSourceLocation.adjustLocation(BreakpointLocation.java:183) at com.oracle.truffle.api.debug.Breakpoint$1.onExecute(Breakpoint.java:548) at com.oracle.truffle.api.instrumentation.InstrumentationHandler.notifySourceExecutedBinding(InstrumentationHandler.java:890) ... 16 more

BUT debugger works perfect anyway

My Intellij IDEA debug config (nothing special) Screenshot 2019-10-21 at 20 50 01

via VS Code and Chrome i don't see exceptions.

My setup: OS: macOS 10.15.1 Editor: Intellij IDEA 2019.2 JVM: GraalVM 19.2.1

entlicher commented 4 years ago

This is fixed in the upcoming 19.3. I've tested it with IntelliJ ideaIU-2019.2.3 and everything works fine.

smokeelow commented 4 years ago

@entlicher awesome, thank you!