Return stack frames of crashed thread when using wasm-c-api (#2908)
When using the wasm-c-api and there's a trap, `wasm_func_call()` returns a `wasm_trap_t *` object. No matter which thread crashes, the trap contains the stack frames of the main thread. With this PR, when there's an exception, the stack frames of the thread where the exception occurs are stored into the thread cluster. `wasm_func_call()` can then return those stack frames.
This commit is contained in:
@ -51,6 +51,13 @@ struct WASMCluster {
|
||||
#if WASM_ENABLE_DEBUG_INTERP != 0
|
||||
WASMDebugInstance *debug_inst;
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_DUMP_CALL_STACK != 0
|
||||
/* When an exception occurs in a thread, the stack frames of that thread are
|
||||
* saved into the cluster
|
||||
*/
|
||||
Vector exception_frames;
|
||||
#endif
|
||||
};
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user