Enable emitting custom name section to aot file (#794)
Enable emitting custom name section to aot file when adding `--enable-dump-call-stack` or `--enable-dump-call-stack` to wamrc and there is custom name section in wasm file, which can be generated by wasi-sdk/emcc "-g" option. So aot runtime can also get the function name from the custom name section instead of export section, to which developer should use `--export-all` for wasi-sdk/emcc to generate export function names.
This commit is contained in:
@ -418,6 +418,11 @@ struct WASMModule {
|
||||
uint64 load_size;
|
||||
uint64 buf_code_size;
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
|
||||
const uint8 *name_section_buf;
|
||||
const uint8 *name_section_buf_end;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct BlockType {
|
||||
|
||||
@ -3643,7 +3643,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
frame->csp_boundary =
|
||||
frame->csp_bottom + cur_wasm_func->max_block_num;
|
||||
|
||||
/* Initialize the local varialbes */
|
||||
/* Initialize the local variables */
|
||||
memset(frame_lp + cur_func->param_cell_num, 0,
|
||||
(uint32)(cur_func->local_cell_num * 4));
|
||||
|
||||
|
||||
@ -3658,7 +3658,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
word_copy(frame->operand, (uint32 *)cur_wasm_func->consts,
|
||||
cur_wasm_func->const_cell_num);
|
||||
|
||||
/* Initialize the local varialbes */
|
||||
/* Initialize the local variables */
|
||||
memset(frame_lp + cur_func->param_cell_num, 0,
|
||||
(uint32)(cur_func->local_cell_num * 4));
|
||||
|
||||
|
||||
@ -2838,6 +2838,8 @@ load_user_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
|
||||
|
||||
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
|
||||
if (memcmp(p, "name", 4) == 0) {
|
||||
module->name_section_buf = buf;
|
||||
module->name_section_buf_end = buf_end;
|
||||
p += name_len;
|
||||
handle_name_section(p, p_end, module, error_buf, error_buf_size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user