Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Debugging in memory sources(JSR-223 script evaluation allows to run groovy scripts parsed from the string. I would like to debug them.)
Debugging in memory sources [message #1828559] Fri, 12 June 2020 06:37
Martin G ofčík is currently offline Martin G ofčíkFriend
Messages: 3
Registered: July 2009
Junior Member
Groovy script debugging is supported in the eclipse. Groovy script engine allows to execute scripts parsed from the string.

		ScriptEngineFactory factory = new GroovyScriptEngineFactory();
		ScriptEngine scriptEngine = factory.getScriptEngine();
		Bindings bindings = scriptEngine.createBindings();
		scriptEngine.eval("println 'hello world'", bindings);

Groovy script engine creates "a class" with the name 'Script1.groovy' in the memory and executes the script.
I would like to provide an access to this in memory source and debug it.

One possibility could be to create a file 'Script1.groovy' in the source path before script evaluation and put break point into it.
In that case SourceLocator finds the source and the breakpoint and execution is stopped in the class.

What I would like to achieve is to provide sources from the groovy script engine, which stores them in memory.
Is it possible? How can I do that?

Thank you in advance for your help.
Previous Topic:Cannot connect to VM
Next Topic:Eclipse Variables View
Goto Forum:

Current Time: Fri May 14 20:57:27 GMT 2021

Powered by FUDForum. Page generated in 0.02197 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top