provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

Not stopping on breakpoint #107

Open mskcork opened 4 years ago

mskcork commented 4 years ago

Using C:\Program Files\AdoptOpenJDK\jdk-11.0.5.10-openj9

See errors in attached logs

ncdbg.log

provegard commented 4 years ago

I was just wondering yesterday whether anyone uses ncdbg anymore. I guess this answers it. :)

I will try to take a look at this in the coming days. Please be patient.

provegard commented 4 years ago

Apologies for the delay. I can reproduce the bug but I have no solution yet.

mskcork commented 4 years ago

Thanks for the update. I appreciate the effort.

davidpcaldwell commented 4 years ago

I've also picked up ncdbg again (as a user) after a layoff. Right now I can't hit breakpoints in VSCode, although I can use the debugger keyword. Perhaps that's a workaround for @mskcork.

I can't do anything in Chrome DevTools (basically the URL ncdbg tells me to go to doesn't open DevTools in Chrome anymore). That's using 0.8.4., haven't looked at master. I may log an issue about that at some point. :)

provegard commented 4 years ago

@davidpcaldwell I also noticed the URL doesn't work. The new one seems to be:

devtools://devtools/bundled/inspector.html?ws=${listenAddr.host}:${listenAddr.port}/dbg

I have some unpushed commits, will push them shortly.

@mskcork I have been swamped with work, so I haven't really had time to look at this. But I have some time tomorrow, so here's hoping I can find a solution.

davidpcaldwell commented 4 years ago

Sounds good, @provegard -- DevTools API seems to be the way to go in JavaScript debugging these days, so good that you've implemented it for Nashorn. I'll have a look at your URL soon -- my script authors tthat URL itself, so I ahould be able to work around it if the output from ncdbg is incorrect.

In the meantime, good luck! I am not yet running from a local checkout, but I was once, and can get back to there to help with validation if I do.

davidpcaldwell commented 4 years ago

Using the new URL you provided, @provegard, I am able to debug in Chrome, same situation as VSCode -- scripts stop at debugger; but not at breakpoints, best I can tell.

provegard commented 4 years ago

Ok, I tried this morning and it stopped on breakpoints when running the target with OpenJDK 13, but not OpenJDK11-OpenJ9.

provegard commented 4 years ago

@davidpcaldwell which JDK do you use?

mskcork commented 4 years ago

Many thanks for all the effort and the feedback.

davidpcaldwell commented 4 years ago

My test was with this: "java.runtime.version": "1.8.0_232-BellSoft-b10". Running with JDK 11 I get a different error having to do with JAVA_HOME being wrong, not sure how that's happening -- I'll have to poke at it.

Update: looks like my ncdbg launching script makes a wrong assumption about the structure of the JDK 11 distribution. I'll fix it and see what happens.

Update (ha!): My Nashorn embedding doesn't work on JDK 11. So I'll have to debug that first. But ncdbg at least breaks on the exception!

benoitcerrina commented 4 years ago

I was just wondering yesterday whether anyone uses ncdbg anymore. I guess this answers it. :)

I will try to take a look at this in the coming days. Please be patient.

Hello, we have had issues with ncdbg not stopping for a while now and had stopped using it, we are testing the newest version. Hopefully we can make it work because it was of great use to us in the past. Also thanks again for working on it, obviously a reliable debugging tool for Nashorn should have been the responsibiltiy of Oracle but instead they decided to deprecate it.

provegard commented 4 years ago

@benoitcerrina which JDK do you use?

provegard commented 4 years ago

@mskcork the error in the log file tells us that the remote JVM does not recognize java.lang.Object[] for the class loader in question. This is quite odd. I have opened an issue in the OpenJ9 repo: https://github.com/eclipse/openj9/issues/9965

When I test with a regular OpenJDK 11 JVM, ncdbg stops on breakpoints as expected.

provegard commented 4 years ago

@mskcork there should be a fix in the OpenJ9 project, see the linked issue. I do not know when that fix will make it into a release.

@benoitcerrina @davidpcaldwell if you have experienced the same thing, do you have any exception stack traces to share?