| 1 | #ifndef wren_debug_h |
| 2 | #define wren_debug_h |
| 3 | |
| 4 | #include "wren_value.h" |
| 5 | #include "wren_vm.h" |
| 6 | |
| 7 | // Prints the stack trace for the current fiber. |
| 8 | // |
| 9 | // Used when a fiber throws a runtime error which is not caught. |
| 10 | void wrenDebugPrintStackTrace(WrenVM* vm); |
| 11 | |
| 12 | // The "dump" functions are used for debugging Wren itself. Normal code paths |
| 13 | // will not call them unless one of the various DEBUG_ flags is enabled. |
| 14 | |
| 15 | // Prints a representation of [value] to stdout. |
| 16 | void wrenDumpValue(Value value); |
| 17 | |
| 18 | // Prints a representation of the bytecode for [fn] at instruction [i]. |
| 19 | int wrenDumpInstruction(WrenVM* vm, ObjFn* fn, int i); |
| 20 | |
| 21 | // Prints the disassembled code for [fn] to stdout. |
| 22 | void wrenDumpCode(WrenVM* vm, ObjFn* fn); |
| 23 | |
| 24 | // Prints the contents of the current stack for [fiber] to stdout. |
| 25 | void wrenDumpStack(ObjFiber* fiber); |
| 26 | |
| 27 | #endif |
| 28 | |