debugger_panel.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .. _doc_debugger_panel:
  2. Debugger panel
  3. ==============
  4. Many of Godot's debugging tools, including the debugger, can be found in the
  5. debugger panel at the bottom of the screen. Click on **Debugger** to open it.
  6. .. image:: img/overview_debugger.png
  7. The debugger panel is split into several tabs, each focusing on a specific task.
  8. Debugger
  9. ++++++++
  10. The Debugger tab opens automatically when the GDScript compiler reaches
  11. a breakpoint in your code.
  12. It gives you a `stack trace <https://en.wikipedia.org/wiki/Stack_trace>`__,
  13. information about the state of the object, and buttons to control the program's
  14. execution. When the debugger breaks on a breakpoint, a green triangle arrow is
  15. visible in the script editor's gutter. This arrow indicates the line of code the
  16. debugger broke on.
  17. .. tip::
  18. You can create a breakpoint by clicking the gutter in the left of the script
  19. editor (on the left of the line numbers). When hovering this gutter, you
  20. will see a transparent red dot appearing, which turns into an opaque red dot
  21. after the breakpoint is placed by clicking. Click the red dot again to
  22. remove the breakpoint. Breakpoints created this way persist across editor
  23. restarts, even if the script wasn't saved when exiting the editor.
  24. You can also use the ``breakpoint`` keyword in GDScript to create a
  25. breakpoint that is stored in the script itself. Unlike breakpoints created by
  26. clicking in the gutter, this keyword-based breakpoint is persistent across
  27. different machines when using version control.
  28. You can use the buttons in the top-right corner to:
  29. - Skip all breakpoints. That way, you can save breakpoints for future
  30. debugging sessions.
  31. - Copy the current error message.
  32. - **Step Into** the code. This button takes you to the next line of code,
  33. and if it's a function, it steps line-by-line through the function.
  34. - **Step Over** the code. This button goes to the next line of code,
  35. but it doesn't step line-by-line through functions.
  36. - **Break**. This button pauses the game's execution.
  37. - **Continue**. This button resumes the game after a breakpoint or pause.
  38. .. warning::
  39. Breakpoints won't break on code if it's
  40. :ref:`running in a thread <doc_using_multiple_threads>`.
  41. This is a current limitation of the GDScript debugger.
  42. Errors
  43. ++++++
  44. This is where error and warning messages are printed while running the game.
  45. You can disable specific warnings in **Project Settings > Debug > GDScript**.
  46. Profiler
  47. ++++++++
  48. The debugger comes with three profilers for your processor, network operations,
  49. and video memory.
  50. The profiler is used to show why individual frames take as long as they do
  51. to process and render.
  52. Unlike other debugging tools, the profiler does not start automatically. It can
  53. be started at any time during gameplay by pressing the start button. You can
  54. even start the profiler before opening the game to profile startup performance.
  55. It can also be started and stopped while the game is running without losing
  56. information from when it was last running. The information it records won't
  57. go away unless you click clear, or close the game, reopen it and start
  58. the profiler again.
  59. After starting and stopping the profiler, you should see things being kept track
  60. of on the left and a graph on the right. The items listed on the left are
  61. everything that contributes to frame time, and they should each have a value
  62. for time and calls for the current frame you are looking at.
  63. The frame number in the top right tells you which frame you are currently
  64. looking at. You can change this by using the up or down arrows, typing in the
  65. frame number, or clicking on the graph.
  66. If you want to add something to your graph or think it looks too cluttered,
  67. you can check and uncheck the box next to an item to add or remove it
  68. from the graph.
  69. Network Profiler
  70. ++++++++++++++++
  71. The Network Profiler contains a list of all the nodes that communicate over the
  72. multiplayer API and, for each one, some counters on the amount of incoming and
  73. outgoing network interactions. It also features a bandwidth meter that displays
  74. the total bandwidth usage at any given moment.
  75. Monitors
  76. ++++++++
  77. The monitors are graphs of several aspects of the game while its running such as
  78. FPS, memory usage, how many nodes are in a scene and more. All monitors keep
  79. track of stats automatically, so even if one monitor isn't open while the game
  80. is running, you can open it later and see how the values changed.
  81. Video RAM
  82. +++++++++
  83. The **Video RAM** tab shows the video RAM usage of the game while it is running.
  84. It provides a list of every resource using video RAM by resource path, the type
  85. of resource it is, what format it is in, and how much Video RAM that resource is
  86. using. There is also a total video RAM usage number at the top right of the panel.
  87. .. image:: img/video_ram.png
  88. Misc
  89. ++++
  90. The **Misc** tab contains tools to identify the control nodes you are clicking
  91. at runtime:
  92. - **Clicked Control** tells you where the clicked node is in the scene tree.
  93. - **Clicked Control Type** tells you the type of the node you clicked is.