One of the great advantages of visual dataflow programming is that you can
watch data flow through your graph. Phograph has a built-in debugger
that lets you set breakpoints, step through execution, and inspect values on
every wire.
The Run menu
All debugging commands are in the Run menu:
Command
Shortcut
Description
Run
Cmd+R
Run the current method at full speed
Debug
Cmd+Shift+R
Run with debugger attached
Stop
Cmd+.
Stop execution
Continue
Cmd+\
Resume from breakpoint
Step Over
Cmd+'
Execute one node, skip into method calls
Step Into
Cmd+;
Execute one node, enter method calls
Clear Console
Cmd+K
Clear the console output
Setting breakpoints
A breakpoint pauses execution when the debugger reaches a specific
node. To toggle a breakpoint:
Right-click a node on the canvas.
Choose Toggle Breakpoint.
A red dot appears in the top-left corner of the node.
Right-click the same node again and choose Remove Breakpoint to clear it.
Debugging a program
Load the Basic Arithmetic example.
Set a breakpoint on the * (multiply) node.
Press Cmd+Shift+R to start debugging.
Execution runs until it reaches the * node, then pauses.
When paused:
The paused node is highlighted in yellow.
A debug toolbar appears at the top with Continue, Step Over, Step Into, and Stop buttons.
The status bar shows which node you’re paused at and the current step number.
Wire values may be shown as labels on the wires (trace overlay).
Step Over vs Step Into
When paused, you choose how to advance:
Step Over (Cmd+') — execute the current node and pause
at the next one. If the node is a method call, the entire called method runs to
completion without stopping.
Step Into (Cmd+;) — if the node is a method call,
enter that method and pause at its first node. For primitives, this behaves like
Step Over.
Continue (Cmd+\) — resume execution at full
speed until the next breakpoint or completion.
When to use which
Use Step Over when you trust a method works and just want its result.
Use Step Into when you want to see what happens inside a method call.
Use Continue when you want to skip ahead to the next breakpoint.
The console during debugging
The console shows log and inspect output as nodes execute.
When a debug session completes, the final status appears.
Exercise 8.1 — Step through Basic Arithmetic
Load the Basic Arithmetic example.
Set a breakpoint on the + node.
Press Cmd+Shift+R to debug.
When it pauses at +, press Cmd+' (Step Over).
The + node executes and the debugger pauses at the next node (*).
Step Over again. * executes and the result flows to the output bar.
The debug session completes.
Check the console — you should see the output 14.
Exercise 8.2 — Step Into a method call
Load the Fibonacci example.
Set a breakpoint on the fib method-call node in main.
Debug (Cmd+Shift+R).
When it pauses at fib, press Cmd+; (Step Into).
You should now be inside the fib method, paused at its first node.
Press Cmd+\ (Continue) to let it finish.
Exercise 8.3 — Debug your own code
Open the temperature converter from Exercise 3.1 (or recreate it).
Set breakpoints on each arithmetic node.
Debug and step through, verifying each intermediate result:
212 - 32 = 180
180 * 5 = 900
900 / 9 = 100
This is the power of visual debugging — you can see every value at every step.
Exercise 8.4 — Find a bug
Build this (intentionally buggy) program:
Method main: constant 10, constant 3,
wire to -, then wire the result to * with itself
(fan-out from the - output). Wire to output bar.
Intended: (10 - 3)^2 = 49.
But suppose you accidentally wired the constants backwards (3 - 10 = -7).
The result would be 49 anyway (because (-7)^2 = 49)!
Use the debugger to step through and verify the intermediate value is
7, not -7. Fix if needed.
Lesson
Visual debugging catches sign errors and wiring mistakes that might go
unnoticed when only the final result is checked. Always step through new
code at least once to verify intermediate values.
Tips for effective debugging
Use inspect nodes to permanently log intermediate values even
when not debugging.
Set breakpoints sparingly — put them near where you suspect a problem.
Use Step Into only when you need to investigate a specific method. Step Over
everything else to avoid getting lost.
The debugger traces values on wires. Look at wire labels during a pause to
verify data is what you expect.
Key Concepts
Debug (Cmd+Shift+R) runs with the debugger attached.
Breakpoints (right-click > Toggle Breakpoint) pause at a node.
Step Over advances one node without entering method calls.
Step Into enters method calls to debug them.
Continue runs to the next breakpoint.
Visual debugging lets you see data flowing through your graph.