Skip to content
haviital edited this page Apr 12, 2023 · 10 revisions

Summary

Below the sourcecode view, there is a multi-mode console. If you are debugging your game, the console allows you to send commands directly to GDB.

You can also use it for evaluating javascript expressions by using the = prefix: =1+2 // prints 3

Pressing the up/down keys will show the previous commands you typed, as it would in a terminal.

Common (gdb) debugging commands:

  • p points - Prints the value of the points variable
  • set points=100 - Sets the value of the points variable to 100.
  • x/30c workBuffer - Prints the memory area starting from the workBuffer(pointer). Prints 30 characters(bytes).
  • p/x *workBuffer@30 - Prints the array workBuffer. Prints first 30 bytes as hex values.
  • watch foo - Sets a watchpoint. Breaks when foo changes.
  • where - Shows the call stack. This list is not truncated like the one in the right window in FemtoIDE.
  • f 5 - Swithes to the call stack frame #5.
  • jump 123 - Restarts executing from the line 123 in the current source file.
  • info locals - Show local variables in the current function.
  • info args - Show argument variables in the current function.
Clone this wiki locally