Debugger
Introduction to the Debugger
The JARU IDE debugger allows you to execute your code step by step, inspect variables, and find errors efficiently.
Breakpoints
Breakpoints stop execution at a specific line.
Adding a Breakpoint
- Click on the left margin next to the line number
- Or position the cursor on the line and press
F9
A red circle will appear indicating the breakpoint.
Removing a Breakpoint
- Click on the red circle again
- Or press
F9on the line
Temporarily Disable
- Right-click on the breakpoint > "Disable"
- The circle will become hollow
Start Debugging
- Add at least one breakpoint
- Press
F5or click "Debug" - Execution will stop at the first breakpoint
Debug Controls
| Action | Shortcut | Description |
|---|---|---|
| Continue | F5 | Continue to the next breakpoint |
| Step Over | F10 | Execute current line without entering functions |
| Step Into | F11 | Enter the function on the current line |
| Step Out | Shift+F11 | Exit the current function |
| Stop | Shift+F5 | Stop debugging |
| Restart | Ctrl+Shift+F5 | Restart debugging |
Variables Panel
During debugging, the variables panel shows:
Local Variables
Variables in the current scope:
📁 Locals
├── i: 5
├── name: "John"
└── list: [1, 2, 3]
Global Variables
Variables defined in the global scope.
this
Properties of the current object (inside a class).
Watch Window
The Watch window allows you to observe specific expressions.
Adding an Expression
- Open the Watch panel
- Click "Add expression"
- Type the variable or expression (e.g.,
person.age,list[0],a + b)
Valid Expressions
- Simple variables:
counter - Properties:
object.property - Indexes:
list[0] - Expressions:
a + b * 2 - Calls:
len(list)
The Watch window updates values in real-time while debugging.
Call Stack
Shows the sequence of functions that led to the current point:
📚 Call Stack
├── calculate() - line 25
├── process() - line 18
└── main() - line 5
Click on any entry to jump to that location.
Debug Console
During debugging you can:
- View output from
printandprintln - Evaluate expressions by typing in the console
- View error messages
Practical Example
func factorial(n)
if (n <= 1) then // Add breakpoint here
return 1
end
return n * factorial(n - 1)
end
var result = factorial(5)
print(result)
- Add a breakpoint on the
ifline - Press
F5to start - Observe the value of
nin the variables panel - Use
F5to continue and see hownchanges in each recursive call
Tips
- Use conditional breakpoints for specific cases
- The Watch window is ideal for complex expressions
- Step Over (
F10) is faster than Step Into (F11) when you don't need to enter known functions
Step-by-step debugging is slower than normal execution. Use breakpoints strategically instead of going through all the code line by line.