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

Pausing on uncaught exception doesn't really work #52

Closed provegard closed 7 years ago

provegard commented 7 years ago
[2017-08-01T08:05:20.146Z] [NashornDebuggerHost][ERROR]: Failed to handle event com.sun.tools.jdi.EventSetImpl$ExceptionEventImpl
Unexpected - no stack frame head
  at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerHost.doPause(NashornDebuggerHost.scala:1057)
  at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerHost.handleBreakpoint(NashornDebuggerHost.scala:1012)
  at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerHost.$anonfun$handleOperation$1(NashornDebuggerHost.scala:575)
  at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerHost.$anonfun$handleOperation$1$adapted(NashornDebuggerHost.scala:535)
provegard commented 7 years ago

This seems to be because the JavaAdapter for the run function has a try-catch that converts a Throwable into a RuntimeException, which means that the point where an uncaught exception is thrown is inside that JavaAdapter, which is unknown to us.