Wasmtime
|
#include <wasm.h>
Go to the source code of this file.
Typedefs | |
typedef uint8_t | wasmtime_trap_code_t |
Code of an instruction trap. More... | |
Functions | |
wasm_trap_t * | wasmtime_trap_new (const char *msg, size_t msg_len) |
Creates a new trap. More... | |
bool | wasmtime_trap_code (const wasm_trap_t *, wasmtime_trap_code_t *code) |
Attempts to extract the trap code from this trap. More... | |
const wasm_name_t * | wasmtime_frame_func_name (const wasm_frame_t *) |
Returns a human-readable name for this frame's function. More... | |
const wasm_name_t * | wasmtime_frame_module_name (const wasm_frame_t *) |
Returns a human-readable name for this frame's module. More... | |
Wasmtime APIs for interacting with traps and extensions to wasm_trap_t.
typedef uint8_t wasmtime_trap_code_t |
Code of an instruction trap.
See wasmtime_trap_code_enum for possible values.
Trap codes for instruction traps.
const wasm_name_t * wasmtime_frame_func_name | ( | const wasm_frame_t * | ) |
Returns a human-readable name for this frame's function.
This function will attempt to load a human-readable name for function this frame points to. This function may return NULL
.
The lifetime of the returned name is the same as the wasm_frame_t itself.
const wasm_name_t * wasmtime_frame_module_name | ( | const wasm_frame_t * | ) |
Returns a human-readable name for this frame's module.
This function will attempt to load a human-readable name for module this frame points to. This function may return NULL
.
The lifetime of the returned name is the same as the wasm_frame_t itself.
bool wasmtime_trap_code | ( | const wasm_trap_t * | , |
wasmtime_trap_code_t * | code | ||
) |
Attempts to extract the trap code from this trap.
Returns true
if the trap is an instruction trap triggered while executing Wasm. If true
is returned then the trap code is returned through the code
pointer. If false
is returned then this is not an instruction trap – traps can also be created using wasm_trap_new, or occur with WASI modules exiting with a certain exit code.
wasm_trap_t * wasmtime_trap_new | ( | const char * | msg, |
size_t | msg_len | ||
) |
Creates a new trap.
msg | the message to associate with this trap |
msg_len | the byte length of msg |
The wasm_trap_t returned is owned by the caller.