This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262752 - node.js JPDA Debugger doesn't start for GraalVM @ 0.13 node.js implementation
Summary: node.js JPDA Debugger doesn't start for GraalVM @ 0.13 node.js implementation
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Node.js Debugger (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2016-07-10 12:48 UTC by Jaroslav Tulach
Modified: 2016-08-07 07:40 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2016-07-10 12:48:58 UTC
javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java 

has a special support for detecting and executing on top of GraalVM. However (as GraalVM @ 0.13 doesn't support V8 protocol) debugging doesn't work. Moreover it would be "just" a V8 debugging of JavaScript while the debugger.jpda.truffle gives us a chance to do real multi language debugging.

This issue is my attempt to connect NetBeans Node.js support with NetBeans Truffle debugger.
Comment 1 Jaroslav Tulach 2016-07-10 12:57:54 UTC
Initial implementation is shown at
http://hg.netbeans.org/core-main/rev/TruffleNodeDebugger262752
Petr can verify I am using StartupExtender in a sort-of-OK way. Tomáš has to confirm that opening the NodeJsSupport this way is OK. Jan and Martin need to negotiate the option to pass to GraalVM node executable.
Comment 2 Petr Hejl 2016-07-11 14:21:30 UTC
(In reply to Jaroslav Tulach from comment #1)
> Petr can verify I am using StartupExtender in a sort-of-OK way.
Seems to be ok from my point of view.
Comment 3 Jaroslav Tulach 2016-07-12 07:52:06 UTC
Jan pointed out that GraalVM@0.13 supports -J flags:
http://hg.netbeans.org/core-main/diff/85854c884cbb/debugger.jpda.truffle/src/org/netbeans/modules/debugger/jpda/truffle/node/GraalVmStartupExtender.java


All my changes are visible in 
http://hg.netbeans.org/core-main/rev/8215131c62a5

I am now able to start 
$ netbeans --jdkhome graalvm-0.13-dk
and create a Node.js project, run it on GraalVM's node.js implementation and debug it (with Truffle Debug Plugin built-in).
Comment 4 Tomas Mysik 2016-07-19 11:30:40 UTC
TM01: Could we avoid making node.js API public? I really prefer to keep it as a friend API.

Thanks.
Comment 5 Jaroslav Tulach 2016-07-26 10:03:38 UTC
TM01 is fixed in http://hg.netbeans.org/core-main/rev/b27aa1b15ed3
Comment 6 Tomas Mysik 2016-07-26 12:03:00 UTC
OK for me. Thanks.
Comment 7 Jaroslav Tulach 2016-07-26 13:37:09 UTC
Introducing new eager module to bridge between node.js and truffle debugger:
http://hg.netbeans.org/core-main/rev/39b2dbdbc811

All current changes visible as
http://hg.netbeans.org/core-main/rev/5b4996ba3f67
Comment 8 Martin Entlicher 2016-07-26 17:00:29 UTC
I just made the test for node coming from GraalVM installation more reliable.
http://hg.netbeans.org/core-main/rev/1a8a3c34642f

Is it ready to integrate? It has a go from me. :-)
Comment 9 Martin Entlicher 2016-07-27 13:14:43 UTC
Thanks for the patches and review, the branch TruffleNodeDebugger262752 is merged into trunk:
http://hg.netbeans.org/core-main/rev/c4062ae9433f
Comment 10 Jaroslav Tulach 2016-08-07 07:40:32 UTC
I see [nbms-and-javadoc job](http://deadlock.netbeans.org/job/nbms-and-javadoc/)
got finally blue in build #4744 on Aug 3rd, 2016, so I am trying:

- build NetBeans at 92981beaa830 - e.g. tip of today
- start with empty dir
- use Plugin Manager to get Truffle debug support
- also the trufflenode module is installed
- debugging node.js project (when NB running on GraalVM) works

I think we can verify this issue.