Blame

50ea2e lisa 2026-08-16 22:03:23
sd: add C08 reference (debugging & alpha testing) — 9 pages ported from C08-Reference-Godot; hub link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1
<!-- Generated from applied-computing-au vic/unit3-4/sat/C08-2026/C08-Reference-Godot by port-reference-godot-to-wiki.py — do not hand-edit; re-run the port. -->
2
# Godot Debugging Tools — GDScript
3
4
*The 90-second tour of what Godot gives you for debugging. For the hands-on breakpoint workflow, see [Debugging with Breakpoints in Godot](/sd/C08/Debugging%20with%20Breakpoints%20in%20Godot).*
5
6
**Definition.** *Debugging* is finding and fixing the errors in your program: syntax errors (won't run), logic errors (runs, but the result is wrong) and run-time errors (crashes while running). The C8-1 rubric looks for **debugging statements** at level 3–4 and **breakpoints** at level 5–6 — used on your own project, not described in the abstract.
7
8
## Print debugging — the "debugging statements"
9
10
Everything prints to the **Output** panel at the bottom of the editor.
11
12
```gdscript
4d4b35 lisa 2026-08-18 12:53:37
C08: add Debugging with Tetris practice page and real editor screenshots Generated from C08-Reference-Godot via the port script. Three seeded-bug practice branches on jeremy-oz/godot-tetris; Godot Debugging Tools now shows the Output panel, a paused breakpoint, and the Locals close-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sby5b7atWGmZBLBRz9Mynb
13
print("DEBUG: score = ", score) # always prints
14
print_debug("reached lock_piece()") # adds the script and line number
15
push_warning("shape bag is empty") # yellow warning in the Debugger's Errors tab
16
push_error("negative score!") # red error in the Errors tab (does not stop the game)
50ea2e lisa 2026-08-16 22:03:23
sd: add C08 reference (debugging & alpha testing) — 9 pages ported from C08-Reference-Godot; hub link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
17
```
18
4d4b35 lisa 2026-08-18 12:53:37
C08: add Debugging with Tetris practice page and real editor screenshots Generated from C08-Reference-Godot via the port script. Three seeded-bug practice branches on jeremy-oz/godot-tetris; Godot Debugging Tools now shows the Output panel, a paused breakpoint, and the Locals close-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sby5b7atWGmZBLBRz9Mynb
19
![The Output panel: print shows the value, print_debug adds the script, line and function it fired from](Godot%20Debugging%20Tools/godot_output_panel.png)
20
50ea2e lisa 2026-08-16 22:03:23
sd: add C08 reference (debugging & alpha testing) — 9 pages ported from C08-Reference-Godot; hub link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21
A debugging statement earns its keep when it answers a question: *what value does this variable hold? did this line run at all? in what order?* Comment it out once answered — the added-then-removed print in your git history is itself debugging evidence.
22
23
## The Debugger panel
24
4d4b35 lisa 2026-08-18 12:53:37
C08: add Debugging with Tetris practice page and real editor screenshots Generated from C08-Reference-Godot via the port script. Three seeded-bug practice branches on jeremy-oz/godot-tetris; Godot Debugging Tools now shows the Output panel, a paused breakpoint, and the Locals close-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sby5b7atWGmZBLBRz9Mynb
25
Opens at the bottom when your game hits a breakpoint or crashes on an error. Here is the whole editor at the moment a breakpoint pauses the game — the yellow arrow marks the paused line, and the Debugger panel takes over the bottom:
26
27
![The Godot editor paused at a breakpoint: script at the paused line, Debugger panel below, remote scene tree at the left](Godot%20Debugging%20Tools/godot_debugger_paused.png)
50ea2e lisa 2026-08-16 22:03:23
sd: add C08 reference (debugging & alpha testing) — 9 pages ported from C08-Reference-Godot; hub link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
28
29
| Where to look | What it shows |
30
|---|---|
31
| **Stack Trace / Stack Frames** | which function called which — where you are and how execution got there |
32
| **Locals** | every variable in the current function and its value *right now* |
33
| **Breakpoints** | every red dot in your project — jump to, disable or delete them |
34
| **Errors** | run-time errors and warnings, with clickable locations |
35
4d4b35 lisa 2026-08-18 12:53:37
C08: add Debugging with Tetris practice page and real editor screenshots Generated from C08-Reference-Godot via the port script. Three seeded-bug practice branches on jeremy-oz/godot-tetris; Godot Debugging Tools now shows the Output panel, a paused breakpoint, and the Locals close-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sby5b7atWGmZBLBRz9Mynb
36
A close-up of the panel while paused — Stack Frames on the left (`check_rows` was called by `lock_piece`, and so on up the chain), Locals on the right showing `cleared`, `row` and `count` at this exact moment:
37
38
![Close-up of the Debugger panel: Stack Frames and the Locals values at the paused line](Godot%20Debugging%20Tools/godot_debugger_locals.png)
39
50ea2e lisa 2026-08-16 22:03:23
sd: add C08 reference (debugging & alpha testing) — 9 pages ported from C08-Reference-Godot; hub link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40
## Breakpoints
41
42
Click in the gutter left of a line number — a red dot appears. Run the scene; the game pauses on that line and the Debugger opens, with **Continue**, **Step Over** and **Step Into** buttons. Breakpoints survive editor restarts, and the `breakpoint` keyword in GDScript sets one from code. Full workflow: [Debugging with Breakpoints in Godot](/sd/C08/Debugging%20with%20Breakpoints%20in%20Godot).
43
44
## Two more worth knowing
45
46
- **Remote scene tree** — while the game runs, the Scene dock gains a **Remote** tab showing the *live* node tree; click any node to inspect (and even edit) its properties in real time.
47
- **Debug menu** (top of the editor) — *Visible Collision Shapes* draws your collision shapes in the running game; *Synchronize Script Changes* hot-reloads script edits without restarting.
48
49
## Watch
50
51
**Debugging Tips You MUST Know as a Godot Developer** (DevWorm, 5:27) — <https://www.youtube.com/watch?v=PB6YPnRAyjE> — advanced print statements at 02:23, breakpoints at 03:15.
52
53
Full detail: [Overview of debugging tools — official Godot docs](https://docs.godotengine.org/en/stable/tutorials/scripting/debug/overview_of_debugging_tools.html)