05/10/2021, 6:30 AM
Hello, I'm looking for the ways to list the statement/expressions executed while running a simple kotlin program (like beginner level). As if you set a breakline of each of your kotlin program's line of code: I need to tell which statements were reached in which order with which variable values. So far I found: • either use the usual debugger, but that requires IJ. • run the program as a script with jsr223, but that will only output the result and not show individual steps, plus it's hard to extract the variable's content. • Write my own interpreter using ANTLR? I had a look at that yesterday and it's going to be a nightmare to reimplement all the logic... • Java command line debugger? Anything else?


05/10/2021, 10:34 AM
java debug wire protocol is standard across jvms and documented:
start the program with jvmargs
(Java 7/8) or
(Java 9+) and write your own debugger with
or it might be easier to instrument the bytecode, write a javaagent which adds additional logging to the bytecode, sounds like it would be enough for what you're doing