debugger_panel.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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
  14. the program's execution.
  15. You can use the buttons in the top-right corner to:
  16. - Skip all breakpoints. That way, you can save breakpoints for future
  17. debugging sessions.
  18. - Copy the current error message.
  19. - **Step Into** the code. This button takes you to the next line of code,
  20. and if it's a function, it steps line-by-line through the function.
  21. - **Step Over** the code. This button goes to the next line of code,
  22. but it doesn't step line-by-line through functions.
  23. - **Break**. This button pauses the game's execution.
  24. - **Continue**. This button resumes the game after a breakpoint or pause.
  25. .. warning::
  26. Breakpoints won't break on code if it's
  27. :ref:`running in a thread <doc_using_multiple_threads>`.
  28. This is a current limitation of the GDScript debugger.
  29. Errors
  30. ++++++
  31. This is where error and warning messages are printed while running the game.
  32. You can disable specific warnings in **Project Settings > Debug > GDScript**.
  33. Profiler
  34. ++++++++
  35. The debugger comes with three profilers for your processor, network operations,
  36. and video memory.
  37. The profiler is used to show why individual frames take as long as they do
  38. to process and render.
  39. Unlike other debugging tools, the profiler does not start automatically. It can
  40. be started at any time during gameplay by pressing the start button. You can
  41. even start the profiler before opening the game to profile startup performance.
  42. It can also be started and stopped while the game is running without losing
  43. information from when it was last running. The information it records won't
  44. go away unless you click clear, or close the game, reopen it and start
  45. the profiler again.
  46. After starting and stopping the profiler, you should see things being kept track
  47. of on the left and a graph on the right. The items listed on the left are
  48. everything that contributes to frame time, and they should each have a value
  49. for time and calls for the current frame you are looking at.
  50. The frame number in the top right tells you which frame you are currently
  51. looking at. You can change this by using the up or down arrows, typing in the
  52. frame number, or clicking on the graph.
  53. If you want to add something to your graph or think it looks too cluttered,
  54. you can check and uncheck the box next to an item to add or remove it
  55. from the graph.
  56. Network Profiler
  57. ++++++++++++++++
  58. The Network Profiler contains a list of all the nodes that communicate over the
  59. multiplayer API and, for each one, some counters on the amount of incoming and
  60. outgoing network interactions. It also features a bandwidth meter that displays
  61. the total bandwidth usage at any given moment.
  62. Monitors
  63. ++++++++
  64. The monitors are graphs of several aspects of the game while its running such as
  65. FPS, memory usage, how many nodes are in a scene and more. All monitors keep
  66. track of stats automatically, so even if one monitor isn't open while the game
  67. is running, you can open it later and see how the values changed.
  68. Video RAM
  69. +++++++++
  70. The **Video RAM** tab shows the video RAM usage of the game while it is running.
  71. It provides a list of every resource using video RAM by resource path, the type
  72. of resource it is, what format it is in, and how much Video RAM that resource is
  73. using. There is also a total video RAM usage number at the top right of the panel.
  74. .. image:: img/video_ram.png
  75. Misc
  76. ++++
  77. The **Misc** tab contains tools to identify the control nodes you are clicking
  78. at runtime:
  79. - **Clicked Control** tells you where the clicked node is in the scene tree.
  80. - **Clicked Control Type** tells you the type of the node you clicked is.