vendredi 16 septembre 2016

What is java currently doing?

I'm not sure exactly how to word this question, as I'm self-taught and still yet a beginner in Java, but here goes.

I'm writing scripts with a Java api which compile to class files and are executed out of my perspective on a virtual machine (I don't have access to this virtual machine and can't debug my class files from within.) These scripts require observable data to execute and don't run properly unless they've been executed within this virtual machine. As a consequence of the way that these class files are executed, to my knowledge, I can't debug them with my IDE's built-in debugger.

I don't really have the coding vocabulary to even search for answers to that last statement, so please correct me if I'm wrong.

Anyways, the only way which I've determined will allow me to debug these scripts is the classic print-statement method. It's horrible. But it works. And it seems that the entire community for the api uses this method.

I had the idea that I could use reflection to grab information from my classes as they're executing, but this still doesn't give me access to the line-by-line debugging that I'm looking for.

What I'd like to do is monitor the execution of my script step-by-step (every calculation the VM does) and store information about those calculations (variable "foo" in class "bar" becomes 4 on line "soandso") as a sort of running cache which dumps to the system console whenever an error occurs.

Is this possible?





Aucun commentaire:

Enregistrer un commentaire