-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception handle ability for c++ #619
Comments
C++ exception is disabled by static void
__cxa_throw_wrapper(wasm_exec_env_t exec_env,
void *thrown_exception,
void *tinfo,
uint32 table_elem_idx)
{
wasm_module_inst_t module_inst = get_module_inst(exec_env);
char buf[32];
snprintf(buf, sizeof(buf), "%s", "exception thrown by stdc++");
wasm_runtime_set_exception(module_inst, buf);
} You can enable |
For the second question, I will try WAMR_BUILD_DUMP_CALL_STACK and WAMR_BUILD_CUSTOM_NAME_SECTION. For the first question, I see wasm has a topic about exception handle https://github.com/WebAssembly/exception-handling. Is this topic undone or it is not what I want? |
|
@xujuntwt95329 |
Seems the function names are missing in your wasm file, rebuild with |
Did you mean add -g here? |
Yes,and you can use wasm-objdump to check whether there is custom name section in the generated wasm file. |
@xujuntwt95329 The stack I see is: |
Hi, currently it is not possible to get the line number from the WAMR call stack. The line number information is stored in the DWARF sections, and it should be parsed by the debugger to get these information. So currently the simple call stack can only help to find the functions, you still need some print to analyze which line actually cause the exception before the release of debugger feature. |
ok, thanks~ |
We are using wamr and write the program mainly with c++.
I want do some try catch throw in my program but I found that all the excetion I throw will be catch by wamr. And I only can get "c++ excetion happen" then my app goto fail.
Will you please consider to give the catch ability for wasm app?
And I have anther question. I sometime will get some excetion send by wamr like "out of bound XXX". And it mainly becauce my wasm app code has some error. But I can not find which line cause the problem quickly but only by add log line by line or delete code line by line.
Could you please info me which line cause the problem?
Thanks~
The text was updated successfully, but these errors were encountered: