To be useful, the debugger needs to be able to read the symbol information generated by Inform 6 with its -k command line switch. This is usually written out to a file gameinfo.dbg, but can also be loaded from the Blorb file containing the game as a Dbug chunk. Note that this symbol information must be in the XML-based format introduced with Inform 6.33.
The behaviour of the debugger can be controlled through the following command line arguments:
--gameinfo <path> | Specifies the path to the symbol information file, if it is not present in the game's Blorb file. |
--cpu | Display the CPU usage of each game command in the debug console. |
--starttrap | Enter debug mode at startup time. |
--quittrap | Enter debug mode at quit time. |
--crashtrap | Enter debug mode on any fatal error. |
When the game starts, a separate debug console window is opened. Debug commands can be entered into this console when the game is waiting for input (to be precise, during @glk_select calls) and when the interpreter is in debug mode. The available debug commands are:
print <val> | Print a symbol or number. |
bt | Display the current stack backtrace, with local variables. |
break <func> | Set a breakpoint. The func argument must be a function name or the address of a function. Breakpoints currently only work at the start of a function. |
clear <func> | Clear a breakpoint. |
cont | Leave debug mode and continue execution of the game. |