TS 69 JavaFX Debugger

(Difference between revisions)
(Created page with '==Debugger== '''Author:''' [mailto:sunflower@netbeans.org Alexandr Scherbatiy] <br> '''Version:''' 1.1 <br> '''Last update:''' 25 September 2009 <br> '''Introduction:''' <br> ''…')
(Breakpoints)
Line 27: Line 27:
# {{testcase|Set Breakpoints}}
# {{testcase|Set Breakpoints}}
##  Create a JavaFX Script project.  
##  Create a JavaFX Script project.  
-
##  Copy the code to the Main file:<pre>         
+
##  Copy the code to the Main file:
 +
<pre>         
var a = 10;
var a = 10;
var b = 20.5;
var b = 20.5;
Line 39: Line 40:
# {{testcase|Add new line before a breakpoint}}
# {{testcase|Add new line before a breakpoint}}
##  Create a JavaFX Script project.  
##  Create a JavaFX Script project.  
-
##  Copy the code to the Main file:<pre>         
+
##  Copy the code to the Main file:
 +
<pre>         
var a = 10;
var a = 10;
</pre>   
</pre>   
Line 45: Line 47:
##  Debug the project (press &lt;Ctrl+F5&gt;).  
##  Debug the project (press &lt;Ctrl+F5&gt;).  
##  Finish debuger  
##  Finish debuger  
-
##  Add a new line before the ''a'' variable<pre>
+
##  Add a new line before the ''a'' variable
 +
<pre>
// new line  
// new line  
var a = 10;
var a = 10;
Line 53: Line 56:
# {{testcase|Step Into}}
# {{testcase|Step Into}}
##  Create a JavaFX Script project.  
##  Create a JavaFX Script project.  
-
##  Copy the code to the Main file: <pre>
+
##  Copy the code to the Main file:  
 +
<pre>
function a (){
function a (){
     println("a");
     println("a");
Line 70: Line 74:
# {{testcase|Step Out}}
# {{testcase|Step Out}}
##  Create a JavaFX Script project.  
##  Create a JavaFX Script project.  
-
##  Copy the code to the Main file: <pre>
+
##  Copy the code to the Main file:
 +
<pre>
function a (){
function a (){
     println("a");
     println("a");
Line 89: Line 94:
<br>
<br>
-
 
====Watches====
====Watches====

Revision as of 11:34, 21 June 2010

Debugger

Author: Alexandr Scherbatiy
Version: 1.1
Last update: 25 September 2009
Introduction:
Comments:


Contents


Project

  1. Debug Project
    1. Create a JavaFX Script project.
    2. Press Debug Main Project button
    3. Press Finish Debugger Session button.
    • EXPECTED RESULT: Debugger should start.
    • EXPECTED RESULT: Debugger should stop.



Breakpoints

  1. Set Breakpoints
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
         
var a = 10;
var b = 20.5;
var c = a + b;
    1. Set breakpoints (click on the Glyph Gutter in the editor) for a, b and c variables
    2. Debug the project (press <Ctrl+F5>).
    3. Continue debug the project (press <F5>) for each variable.
    • EXPECTED RESULT: Debugger should stop on each breakpoint.
    • EXPECTED RESULT: Debugger should stop after end of the project.
  1. Add new line before a breakpoint
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
         
var a = 10;
    1. Set breakpoints (click on the Glyph Gutter in the editor) to a variable
    2. Debug the project (press <Ctrl+F5>).
    3. Finish debuger
    4. Add a new line before the a variable
// new line 
var a = 10;
    1. Debug the project (press <Ctrl+F5>).
    • EXPECTED RESULT: Debugger should stop on the breakpoint.
  1. Step Into
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
function a (){
    println("a");
}

function b(){
    a();
}

b();   
    1. Set a breakpoint for the b() call on the last line
    2. Debug the project (press <Ctrl+F5>).
    3. Press Step Into button (press <F7>) on the toollbar.
    • EXPECTED RESULT: The green line should point to the b function body.
  1. Step Out
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
function a (){
    println("a");
}

function b(){
    a();
}

b();   
    1. Set a breakpoint for the b() call on the last line
    2. Debug the project (press <Ctrl+F5>).
    3. Press Step Into button (press <F7>) on the toollbar.
    4. Press Step Out button (press <Ctrl+F7>) on the toollbar.
    • EXPECTED RESULT: The green line should point to the b() call on the last line not the a function body.



Watches

  1. Watches Window
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
var a = 10; var b = 20.5; var c = a + b; print(c);
    1. Set breakpoints for print(c); line
    2. Debug the project (press <Ctrl+F5>).
    3. Go to Watches window.
    4. Right-click and select New Watch...
    5. Type a + 10 for the watch expression.
    6. Right-click and select New Watch...
    7. Type c * 2 for the watch expression.
    • EXPECTED RESULT: There should be 20 value for the a + 10 expression.
    • EXPECTED RESULT: There should be 61.0 value for the c * 2 expression.




Variables

  1. Variables Window
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
var i = 3; var num = 3.0; var b = true; var c = "2".charAt(0); var byte:Byte = 1; var short:Short = 2; var long:Long = 3; var float:Float = 5.0; var double:Double = 10.0; var date = 3h; var void = function():Void{}; var str = "Hello!"; class A{} var a = A{}; var f = function(a:Number, b:String):Boolean { true }; var seqf = function(a:A[[ | ]], b:String[[ | ]]):Boolean[[ | ]] { [] }; var seq = ["1","2","3" ]; println("");
    1. Set a breakpoint for last line
    2. Debug the project (press <Ctrl+F5>).
    3. Go to Variables window.
    • EXPECTED RESULT: Each variable should be shown in the Variables window
    • EXPECTED RESULT: Each variable should have the type and the default value
    • For example: There should be i



Breakpoints Window

  1. Breakpoints Window
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
var a = 10; var b = 20.5; var c = a + b;
    1. Set breakpoints for a, b and c variables
    2. Debug the project (press <Ctrl+F5>).
    3. Go to Breakpoints window
    • EXPECTED RESULT: The Breakpoints window should show the set berakpoints



Call Stack Window

  1. Call Stack
    1. Create a JavaFX Script project.
    2. Copy the code to the Main file:
               
      
var a = 10; var b = 20.5; var c = a + b;
    1. Set breakpoints for a, b and c variables
    2. Debug the project (press <Ctrl+F5>).
    3. Go to the Call Stack window
    • EXPECTED RESULT: The current program call stack should be shown.




Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo