Debugger Tutorials

Start Debugging

  • Simply click on the debug icon and the simulator should start.
  • You should not need to make any changes to your code.
  • Debugger libraries and require statements are added for you automatically.

Breakpoints

  • You can set a breakpoint by clicking on the line number in the left hand side of the editor.
  • Breakpoints can be unset in the same way.
  • You can also do this while the simulator is running, this is very useful to quickly check if a line of code is executing.

Step Functions

  • Once at a breakpoint you can step over, step in, step out, or run to cursor.
  • Step in will go into calling functions. Step over will skip them. Step out will skip lines until the function returns.
  • You can use run to cursor instead of placing an additional breakpoint.

Variables Viewer

  • Variables view allows you to see all local and global variables at a breakpoint.
  • You can double click on a variable to jump to its declaration in the editor.
  • Variables streamed from the debugger show up in the code completion.

Watches

  • You can create watches by double clicking on the "Enter new watch" field in the variables view.
  • Alternatively you can right click on a variable and select create fixed watch.
  • You can also enter expressions as watches, just be careful of calling functions with side effects.

Call Stack

  • The call stack is like a history of function calls.
  • This is very useful when debugging error states in utility functions caused by incorrect parameters.
  • You can double click on the callstack frames to go to the caller line.