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 250263 - Stepping from Java code into JavaScript code does not work with Truffle JDK
Summary: Stepping from Java code into JavaScript code does not work with Truffle JDK
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 11:00 UTC by Jiri Kovalsky
Modified: 2015-06-11 15:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project reproducing the described inability to step through JavaScript code. (15.78 KB, application/x-java-archive)
2015-02-06 11:00 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-02-06 11:00:04 UTC
Created attachment 151854 [details]
Project reproducing the described inability to step through JavaScript code.

Product Version: NetBeans IDE Dev (Build 201502060001)
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)

Description:
============
It is not possible to use "Step Into" action to call JavaScript function from Java code. The JavaScript code is simply executed as with "Step Over" action. I can't even get breakpoints in that JavaScript file working. I doubt it is a configuration issue though.

Steps to reproduce:
===================
1. Using "Tools > Java Platforms" register latest version of Truffle JDK 8.
2. Open attached project, invoke its "Properties" and in "Libraries" category make sure it uses the Truffle JDK 8.
3. Open "Source Packages > javaapplication10 > calculator.js" file in Editor.
4. Toggle line 3 breakpoint (i.e. with "if (number === 0) return 1;" code).
5. Open "Source Packages > javaapplication10 > JavaApplication10.java" file in Editor.
6. Toggle line 29 breakpoint (i.e. with "Object result = inv.invokeFunction("calculateFactorial", 4);" code).
7. Press Ctrl+F5 to start debugging session.
8. When Java debugger hits line 29 breakpoint press F7 to step into the JavaScript code.

Expected: Editor switches focus to calculator.js with caret highlighting first line of calculateFactorial() function. Pressing F5 would hit line 3 breakpoint in that calculator.js file.
Actual: Caret is moved to line 30 in JavaApplication10 and Debugger Console contains message "Thread main stopped at JavaApplication10.java:30.".
Comment 1 Martin Entlicher 2015-05-18 14:27:05 UTC
This is fixed by changeset:   287883:9a55763f3a75
http://hg.netbeans.org/core-main/rev/9a55763f3a75

There are some workarounds in the code, the Truffle debugging support might be further modified.
Comment 2 Jiri Kovalsky 2015-06-11 09:41:59 UTC
I apologize for bad news but I see no difference in the behaviour. Reopening for further investigation.

Product Version: NetBeans IDE Dev (Build 201506100001)
Java: 1.7.0_76; Java HotSpot(TM) 64-Bit Server VM 24.76-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_76-b13
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 3 Jiri Kovalsky 2015-06-11 11:18:12 UTC
My fault. I didn't have Truffle Debugging Support plugin installed. It kind of works with the plugin, but not the natural way though. When F7 is pressed, "<unknown>" file is opened in Editor with all code in grey background color and line 3 highlighted in green. No tooltips with variable values are provided. If you switch to "calculator.js" file, it looks like line 3 breakpoint is not hit as its color is red but on the other hand if you hover over "number" variable, you will see "number = 4" in the displayed tooltip.

Can you please make sure this anomaly is fixed too? Thanks.
Comment 4 Martin Entlicher 2015-06-11 15:40:07 UTC
The step into itself seems to work fine already, the problem with a read-only version of the file is submitted in issue #252933. The problem with tooltips is a result of a missing .js extension in the "<unknown>" file name. This is to be fixed in Truffle.
Comment 5 Jiri Kovalsky 2015-06-11 15:46:51 UTC
Verifying then, thanks.