provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

Odd behavior when stepping over line with breakpoint #82

Closed provegard closed 6 years ago

provegard commented 6 years ago

When stepping over a line that has a breakpoint, the effect is resume. Also the following error appears:

    Message handling error for domain Debugger
java.lang.IllegalStateException: A breakpoint must be active for stepping to work
    at com.programmaticallyspeaking.ncd.nashorn.StepSupport.step(StepSupport.scala:27)
    at com.programmaticallyspeaking.ncd.nashorn.StepSupport.step$(StepSupport.scala:10)
    at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerHost.step(NashornDebuggerHost.scala:120)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.programmaticallyspeaking.ncd.infra.ExecutorProxy$Handler.$anonfun$invoke$3(ExecutorProxy.scala:42)
    at scala.util.Try$.apply(Try.scala:209)
    at com.programmaticallyspeaking.ncd.infra.ExecutorProxy$Handler.$anonfun$invoke$2(ExecutorProxy.scala:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
provegard commented 6 years ago

There seems to be both a step event and a breakpoint event happening in sequence:

[2018-03-05T00:15:38.862Z] [NashornDebuggerHost][INFO]: AFTER PF (StepEvent@jdk.nashorn.internal.scripts.Script$1$\^eval\_:5 in thread main), doResume = false
[2018-03-05T00:15:38.862Z] [ScriptExecutorRunner][DEBUG]: Dispatching to event observers: HitBreakpoint(ArrayBuffer(StackFrameImpl(ndsf48,ObjectNode(Object,{"id":"uid-2070"}),ListBuffer(Scope(ObjectNode(Object,{"id":"uid-2070"}),global)),nds2:5 (jdk.nashorn.internal.scripts.Script$1$\^eval\_:5),com.programmaticallyspeaking.ncd.nashorn.StackBuilder$$Lambda$472/1724673083@17ce87cd,FunctionDetails(:program))),None,Step)
[2018-03-05T00:15:38.862Z] [NashornDebuggerHost][INFO]: AFTER PF (BreakpointEvent@jdk.nashorn.internal.scripts.Script$1$\^eval\_:5 in thread main), doResume = true
[2018-03-05T00:15:38.862Z] [Debugger][DEBUG]: Handling breakpoint event: HitBreakpoint(ArrayBuffer(StackFrameImpl(ndsf48,ObjectNode(Object,{"id":"uid-2070"}),ListBuffer(Scope(ObjectNode(Object,{"id":"uid-2070"}),global)),nds2:5 (jdk.nashorn.internal.scripts.Script$1$\^eval\_:5),com.programmaticallyspeaking.ncd.nashorn.StackBuilder$$Lambda$472/1724673083@17ce87cd,FunctionDetails(:program))),None,Step)
provegard commented 6 years ago

Event set size = 2