Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitting Debug.breakpoint with chrome inspector fails with NullPointerException #11362

Closed
Akirathan opened this issue Oct 18, 2024 · 1 comment
Assignees
Labels
--bug Type: bug -compiler -tooling Category: tooling

Comments

@Akirathan
Copy link
Member

Run the following code:

from Standard.Base import all

main =
    txt = "Hello"
    Standard.Base.Runtime.Debug.breakpoint
    IO.println "DONE"

with:

enso --inspect --run tmp.enso

And attach chrome inspector. Then just click on continue in the inspector. Then, there will be unexpected failure:

Debugger listening on ws://127.0.0.1:9229/enso_debug
For help, see: https://www.graalvm.org/tools/chrome-debugger
E.g. in Chrome open: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9229/enso_debug
/home/pavel/tmp/tmp.enso:4:5: warning: Unused variable txt.
    4 |     txt = "Hello"
      |     ^~~
WARNING: Instrumented node DebugBreakpointNodeGen@3c488b34 of class class org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeGen has null SourceSection.WARNING: and null encapsulating SourceSection under DebugBreakpointMethodGen@32e697ac of class = class org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGenExecution finished with an error: java.lang.NullPointerException: Cannot invoke "com.oracle.truffle.api.source.SourceSection.getSource()" because "ss" is null
        at <java> com.oracle.truffle.tools.chromeinspector/com.oracle.truffle.tools.chromeinspector.InspectorDebugger$SuspendedCallbackImpl.onSuspend(InspectorDebugger.java:1104)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.DebuggerSession.doSuspend(DebuggerSession.java:1307)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.DebuggerSession.processBreakpointsAndStep(DebuggerSession.java:1275)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.DebuggerSession.notifyCallback(DebuggerSession.java:1081)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.Breakpoint.doBreak(Breakpoint.java:883)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.Breakpoint.doBreak(Breakpoint.java:831)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.Breakpoint$AbstractBreakpointNode.onNode(Breakpoint.java:1470)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.debug.Breakpoint$BreakpointBeforeNode.onEnter(Breakpoint.java:1285)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1499)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:980)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:226)
        at <java> org.enso.runtime/org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at <java> org.enso.runtime/org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:101)
        at <enso> Debug.breakpoint(Internal)
        at <enso> tmp.main(tmp.enso:5:5-42)

Expected behavior

The expression Standard.Base.Runtime.Debug.breakpoint should behave exactly like setting a breakpoint in chrome inspector directly in the file.

@JaroslavTulach
Copy link
Member

Fixed by #11594

@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler -tooling Category: tooling
Projects
Archived in project
Development

No branches or pull requests

2 participants