2021-02-18 02:27:24 +08:00
|
|
|
/*
|
2022-04-03 02:39:57 +08:00
|
|
|
* 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
|
2021-02-18 02:27:24 +08:00
|
|
|
*/
|
|
|
|
|
2022-04-07 08:43:29 +08:00
|
|
|
#ifndef PK_DEBUG_H
|
|
|
|
#define PK_DEBUG_H
|
2021-02-18 02:27:24 +08:00
|
|
|
|
2021-06-21 21:02:20 +08:00
|
|
|
#include "pk_internal.h"
|
2022-04-07 08:43:29 +08:00
|
|
|
#include "pk_value.h"
|
2021-02-18 02:27:24 +08:00
|
|
|
|
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-02-18 02:27:24 +08:00
|
|
|
|
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-02-18 02:27:24 +08:00
|
|
|
|
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);
|
2021-02-25 17:03:06 +08:00
|
|
|
|
2022-04-07 08:43:29 +08:00
|
|
|
#endif // PK_DEBUG_H
|