debugger_panel.rst 3.9 KB

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