pocketlang/src/pk_debug.h

28 lines
778 B
C
Raw Normal View History

/*
* Copyright (c) 2020-2022 Thakee Nathees
* Copyright (c) 2021-2022 Pocketlang Contributors
2021-06-09 18:42:26 +08:00
* Distributed Under The MIT License
*/
#ifndef PK_DEBUG_H
#define PK_DEBUG_H
#include "pk_internal.h"
#include "pk_value.h"
2021-06-12 14:56:09 +08:00
// Dump the value of the [value] without a new line at the end to the buffer
// [buff]. Note that this will not write a null byte at of the buffer
// (unlike dumpFunctionCode).
void dumpValue(PKVM* vm, Var value, pkByteBuffer* buff);
2021-06-12 14:56:09 +08:00
// Dump opcodes of the given function to the buffer [buff].
void dumpFunctionCode(PKVM* vm, Function* func, pkByteBuffer* buff);
2021-05-19 02:59:09 +08:00
// Dump the all the global values of the script.
void dumpGlobalValues(PKVM* vm);
2021-05-16 15:05:54 +08:00
// Dump the current (top most) stack call frame.
void dumpStackFrame(PKVM* vm);
#endif // PK_DEBUG_H