On 17.11.18 20:30, Blake McBride wrote:
I am using Groovy 2.4.15 under NetBeans 8.2 and Java 8 on a 64 bit Linux
I am dynamically loading Groovy with the following code:
if (groovyLoader == null)
groovyLoader = new GroovyClassLoader(GroovyClass.class.getClassLoader());
groovyClass = groovyLoader.parseClass(new GroovyCodeSource(new File(path
+ sourceFile)), false);
Doing it this way, when debugging the loaded class, I am able to set
breakpoints from within IntelliJ and it works as expected. However,
NetBeans ignores the breakpoints.
I do a similar thing with Java files, and NetBeans honors those breakpoints.
since it works under Intellij, it means it cannot be broken totally on
Afaik both use the Java debugger behind the scenes. And afaik you just
tell the debugger to stop at that line in that and that class. Or at
that class in a certain method, maybe at a certain variable init.. To
set a breakpoint in a groovy class You need thus to know the class name.
Maybe Netbeans is unable to generate such a name for something that is
not a regular source file? Frankly this is all very much speculation. I
would actucally suggest you create an issue for netbeans to get somebody
on the netbeans teams with knowledge on the debugger interface to notice
it, and then we can continue to analyse this together.
Since there is no real documentation about how to plant line number
information in the bytecode to let jdb and others stop at the right
position, this is all a lot of trial and error. We do have several
issues around debugging we cannot really resolve, because we miss the
required information. At least I have yet to meet a person that can tell
me. Who knows, maybe there is one in the netbeans team.