|
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_API_EXTERN wasm_trap_t * | wasmtime_trap_new (const char *msg, size_t msg_len) |
| Creates a new trap with the given message. More... | |
| WASM_API_EXTERN wasm_trap_t * | wasmtime_trap_new_code (wasmtime_trap_code_t code) |
| Creates a new trap from the given trap code. More... | |
| WASM_API_EXTERN bool | wasmtime_trap_code (const wasm_trap_t *, wasmtime_trap_code_t *code) |
| Attempts to extract the trap code from this trap. More... | |
| WASM_API_EXTERN const wasm_name_t * | wasmtime_frame_func_name (const wasm_frame_t *) |
| Returns a human-readable name for this frame's function. More... | |
| WASM_API_EXTERN 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.
| WASM_API_EXTERN 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.
| WASM_API_EXTERN 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.
| WASM_API_EXTERN 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_API_EXTERN wasm_trap_t * wasmtime_trap_new | ( | const char * | msg, |
| size_t | msg_len | ||
| ) |
Creates a new trap with the given message.
| 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.
| WASM_API_EXTERN wasm_trap_t * wasmtime_trap_new_code | ( | wasmtime_trap_code_t | code | ) |
Creates a new trap from the given trap code.
| code | the trap code to associate with this trap |
The wasm_trap_t returned is owned by the caller.