You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading some about jvm and Debug Wire Protocol, and it seems you are able to have it break on uncaught exceptions. The only catch being that if there is native code in the call stack, it will sometimes break on an "uncaught exception" that really will be caught by the native code but the jvm can't know that. There is also the PopFrames command that allows to restart execution from some other frame higher up in the stack. It seems a near Common Lisp level experience is possible with clojure on the JVM, to break on uncaught exceptions and inspect local variables in all stack frames and fix code and then restart from some stack frame.
There is this project that uses jvm debug wire protocol to implement a clojure debugger but it is long since abandoned, and cider and flowstorm debugger took a different approach of instrumenting code, which is great but has limitations that you have to first replicate the issue, and then instrument the code and rerun it, rather than having the debugger already present when you first run into the issue. It seems jdwt has almost no overhead when you don't have breakpoints set, so it could even be possible to leave running in production, and log local variables and function arguments and everything at times of exception to easily reproduce whatever exceptions your application throws in production. It seems there is some commercial product for the jvm that does this but I couldn't find anything open source.
It seems it would be promising to build a clojure debugger on top of jdwp that would allow a much better experience regarding breaking on exceptions. Does anyone know why cdt was discontinued and the clojure debuggers that came after took a different approach, are there limitations or difficulties to debugging clojure code with jdwp?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was reading some about jvm and Debug Wire Protocol, and it seems you are able to have it break on uncaught exceptions. The only catch being that if there is native code in the call stack, it will sometimes break on an "uncaught exception" that really will be caught by the native code but the jvm can't know that. There is also the
PopFrames
command that allows to restart execution from some other frame higher up in the stack. It seems a near Common Lisp level experience is possible with clojure on the JVM, to break on uncaught exceptions and inspect local variables in all stack frames and fix code and then restart from some stack frame.There is this project that uses jvm debug wire protocol to implement a clojure debugger but it is long since abandoned, and cider and flowstorm debugger took a different approach of instrumenting code, which is great but has limitations that you have to first replicate the issue, and then instrument the code and rerun it, rather than having the debugger already present when you first run into the issue. It seems jdwt has almost no overhead when you don't have breakpoints set, so it could even be possible to leave running in production, and log local variables and function arguments and everything at times of exception to easily reproduce whatever exceptions your application throws in production. It seems there is some commercial product for the jvm that does this but I couldn't find anything open source.
It seems it would be promising to build a clojure debugger on top of jdwp that would allow a much better experience regarding breaking on exceptions. Does anyone know why cdt was discontinued and the clojure debuggers that came after took a different approach, are there limitations or difficulties to debugging clojure code with jdwp?
Beta Was this translation helpful? Give feedback.
All reactions