-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[wasm] Use g_printerr
to emit errors in mini-wasm.c, so they show up wit…
#49838
Conversation
…h traces in js console
Tagging subscribers to 'arch-wasm': @lewing Issue Details…h traces in the js console. With just printf, you would see the error as:
.. but with g_error, you get: You don't get the message string itself, but that can be found by looking at the source line. Or you can build the runtime with But you do get the stack trace for that error!
|
vargaz: printf in JIT code is mapped to the platform logging operation, so this one can stay as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, stack is more useful than a printf.
- fix g_assert to print a stack?
- do something intltool-like and start moving strings to a table we can link in or out at WasmNativeBuild time?
Is the intention here to turn a benign error into a fatal one? |
@lambdageek makes a (very) good point, please use g_printerr like #49828 |
It gets logged with the stack trace, I confirmed.
|
g_error
to emit errors in mini-wasm.c, so they show up wit…g_printerr
to emit errors in mini-wasm.c, so they show up wit…
…h traces in the js console.
With just printf, you would see the error as:
ThreadPool Callback threw an unhandled exception of type System.TypeInitializationException
.. but with g_error, you get:
You don't get the message string itself, but that can be found by looking at the source line. Or you can build the runtime with
/p:MonoEnableAssertMessages=true
.But you do get the stack trace for that error!