Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] Evaluation engines

Thank you Darin for your reply. I hope you have time for some further discussion...

Darin Wright <Darin_Wright@xxxxxxxxxx> wrote:
Thanks for the report - we will try to look at the bug.

The Local evaluation engine is used only by the scrapbook. It works by
compiling and deploying class files locally with a known name, known
entry point (method), in a known location so the class loader of a
launched VM can find the classes. This only works in a controlled
environment.

Is Local EE supposed to be able to execute the code snippet in the context of a stack frame? Can I call object's methods (without a qualifier) or access its fields (like I can with AST EE)? I noticed that it has its own parser (org.eclipse.jdt.internal.eval.CodeSnippetParser) which appears to be written for this, but so far I can't get this to work, I get only errors

But, being the only user of it is probably not a good idea :-)

I have an idea for a new evaluation engine, which would be based on
hot code replace. It would be 100% correct, but it would require a
dummy method in a class to operate on it's stack frames :-) (since
JVM does not support adding new methods to classes). This makes it
useless to be used generally, but for my own domain it might not be
a big issue. Any input on this??

Hot swap only works in certain situations as well, and that is why we
do not use it to perform debugger evaluations. As you suggest, it
could be used for a specific use case in a controlled environment.

It has a benefit over the Local EE that it wouldn't require a complicated parser of its own. Also, by redefining the class we wouldn't have to force the VM to load it from a certain place. But I think this approach would require a dummy method inside a class, in which context it will be performing the evaluations. Do you know any other solution? I hope there is some trick that I don't know of :-) Anyway if I succeed to write this for my own project I will gladly contribute it to Eclipse


Back to the top