-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NETBEANS-7069] Support Nashorn 15.x for JDK >= 15 #7972
[NETBEANS-7069] Support Nashorn 15.x for JDK >= 15 #7972
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. I left a first set of comments inline. The bad part is, that it does not work for me.
This is the project I used to test: mavenproject3.zip
Baseline is (more or less) current master. I configure the maven project to use JDK 11 for execution and comment out the Nashorn dependency. Then I place a breakpoint in the test.js
file, line 5. Then I invoke "Debug" from the context menu of the project. The IDE starts the programm and the breakpoint in the JS code is hit. This looks like the expected behavior.
I then reconfigured the maven project to run with JDK 21 and reenabled the Nashorn dependency (only out-of-jdk Nashorn is run). With that baseline does not break anywhere, programm just runs through.
Side information I noticed while testing was, that when both out-of-jdk Nashorn and in-jdk Nashorn are present (dependency commented in and running on JDK 11), the out-of-jdk version if preferred by ScriptEngineManager.
With this PR and the same setup I get several hits in java code:
But none in JS. I would first look inside JSJavaBreakpointsManager.java
. One thing to keep in mind in that class is, that it might be called multiple times. NetBeans supports multiple debugging sessions in parallel and then engineAdded
is called multiple times, without calls to engineRemoved
in between.
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/CallStackFrameImpl.java
Outdated
Show resolved
Hide resolved
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/vars/JSVariable.java
Outdated
Show resolved
Hide resolved
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/vars/JSVariable.java
Outdated
Show resolved
Hide resolved
java/debugger.jpda.js/src/org/netbeans/modules/debugger/jpda/js/StepIntoJSHandler.java
Outdated
Show resolved
Hide resolved
Hi @matthiasblaesing , I'll try your project. And yes, problem will be most probably in the JSJavaBreakpointsManager, this is tricky part, because one has to create breakpoints in advance and the debugger instance not available, so I created two sets of breakpoints. I need also put some explanation for potential reader. |
Hi @matthiasblaesing , even though I was able to debug the javascript on my side, I also had those weird breakpoints you mentioned in the screenshots - and in fact, they revealed that I brought some regression(s). I'll work on it before the vacation ends. Libor |
with the last commit I can debug in both cases, I tried
If you could please check on your side again, it will be appreciated. |
Thank you for the update. I confirm, that it works for me and I think we should get this in. @cz6ace would you please squash this, so that I can invoke a final CI/CD run. The current test failure is caused by CI/CD picking up commit messages, that are obviously not final. |
Netbeans does support debugging of legacy Nashorn JavaScript engine bundled with OpenJDK < 15.0. It does not support the the most recent Nashorn 15.4 extracted from OpenJDK, that has different package name. Change allows debugging both legacy Nashorn JavaScript and also extracted Nashorn with new org.openjdk.nashorn package name. Co-authored-by: Matthias Bläsing <[email protected]>
b701ada
to
9a5a9d7
Compare
Good to hear it works on your side too. I did the squash and rebased to the latest master to be sure there's no surprise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me. Lets get this in.
@cz6ace thank you for looking into this. |
Netbeans does support debugging of legacy Nashorn JavaScript engine bundled with OpenJDK < 15.0. It does not support the the most recent Nashorn 15.4 extracted from OpenJDK, that has different package name.
Change allows debugging both legacy Nashorn JavaScript and also extracted Nashorn with new org.openjdk.nashorn package name.
See issue #7069