2015-03-13 15:26:42 +01:00
|
|
|
#ifndef wren_debug_h
|
|
|
|
|
#define wren_debug_h
|
2013-11-30 01:17:33 +01:00
|
|
|
|
|
|
|
|
#include "wren_value.h"
|
|
|
|
|
#include "wren_vm.h"
|
|
|
|
|
|
2015-03-15 18:09:43 +01:00
|
|
|
// Prints the current stack trace for [fiber] to stderr.
|
|
|
|
|
//
|
|
|
|
|
// Used when a fiber throws a runtime error which is not caught.
|
refactor: remove unused WrenVM* parameter from buffer init, string find, and debug print functions
Remove the `WrenVM* vm` parameter from `wrenValueBufferInit`, `wrenByteBufferInit`,
`wrenIntBufferInit`, `wrenStringBufferInit`, `wrenSymbolTableInit`,
`wrenMethodBufferInit`, `wrenStringFind`, and `wrenDebugPrintStackTrace`
functions across the compiler, core, debug, utils, value, and VM modules.
Update all call sites and macro definitions to match the simplified signatures,
eliminating dead parameters that were never used within the function bodies.
2015-03-23 06:17:40 +01:00
|
|
|
void wrenDebugPrintStackTrace(ObjFiber* fiber);
|
2015-03-15 18:09:43 +01:00
|
|
|
|
|
|
|
|
// The "dump" functions are used for debugging Wren itself. Normal code paths
|
|
|
|
|
// will not call them unless one of the various DEBUG_ flags is enabled.
|
|
|
|
|
|
|
|
|
|
// Prints a representation of [value] to stdout.
|
|
|
|
|
void wrenDumpValue(Value value);
|
|
|
|
|
|
|
|
|
|
// Prints a representation of the bytecode for [fn] at instruction [i].
|
|
|
|
|
int wrenDumpInstruction(WrenVM* vm, ObjFn* fn, int i);
|
|
|
|
|
|
|
|
|
|
// Prints the disassembled code for [fn] to stdout.
|
|
|
|
|
void wrenDumpCode(WrenVM* vm, ObjFn* fn);
|
|
|
|
|
|
|
|
|
|
// Prints the contents of the current stack for [fiber] to stdout.
|
|
|
|
|
void wrenDumpStack(ObjFiber* fiber);
|
2013-11-30 01:17:33 +01:00
|
|
|
|
|
|
|
|
#endif
|