Debugging - The-Villains/MajorelleMysteryApp GitHub Wiki

By clicking at the beginning of code line you can set break points, so when the execute game arrives at that line it will halt and you have the opportunity to check what is going on there

adding break points

With the action items in the debugger pane you can step through the program line by line (button with down array).

debugger next line

You can hover with the mouse over the variables in the code to see what is their value or you just look in the "Locals" section where they are also listed. There you can also expand array types to see what is contained

debugging expand array

You may even edit the current values of the variables during debugging, so you can see how this influences the control flow.

The other action buttons are:

  • step into (when there is function called at the current line and you want to follow that)
  • continue (let the program to the next line where a break point has been set)
  • leave out break points (to disable all break points, mostly used in conjunction with the continue button after that)

Some poor man's debugging can be also helpful: just use printt statements like printt("error loading menu ", path) The variable (in that case "path") is then printed to the console while execution, if it is a complex object, you can even expand it there. This is mostly useful when you have complex expressions, that you cannot see / evaluate in normal debug view.