Closed athos closed 4 years ago
@xificurC Any thoughts?
Thanks, I'll test this once merged. I was thinking if it might make sense to allow per-class or per-method emission via e.g. metadata (^:debug
), but the global switch is probably enough
Okay, then I'll merge it first 👍
I was thinking if it might make sense to allow per-class or per-method emission via e.g. metadata (^:debug)
Yeah, I thought there might be such a demand, but I wanted to keep things simple as a first step.
I'm not sure why I wanted you to merge first. No harm done I guess.
I just tested it and the decompiled output shows the variable names and it helped the decompiler decide which local vars were supposed to be final. Thanks!
No worries! I'm happy to hear that result 🤗
This PR enables JiSE emitter to emit local variable info to the resulting bytecode to make it easier to debug it using a stock Java decompiler. Resolves #9.
This behavior is disabled by default (as with
javac
, which generates local variable info if the-g
option is specified). A user can turn it on by setting a new system propertyjise.debug
totrue
. So if you're using Clojure CLI, for example, you can launch a REPL with this debug option enabled withclj -J-Djise.debug=true
.Note that the property name (
jise.debug
) itself is subject to change before the final release.