If the exception being thrown is based on std::exception, this might work,

function whatEmscriptenException(ptr) {
    // 8 should be the vtable offset for the what function
    var fPtr = Module.HEAPU32[(Module.HEAPU32[(ptr) >> 2] + 8) >> 2];
    console.info(Module.AsciiToString(Module.dynCall_ii(fPtr, ptr)));
}
I have that as a snippet in chrome, you'd run it with 
whatEmscriptenException(5489120). This treats that value as a ptr to a 
std::exception object, and tries to call its 'what' function.

On Sunday, March 26, 2017 at 10:52:21 PM UTC-7, Ricky wrote:
>
> Oh, I should add this is all being bound using embind. Not sure if that 
> makes a difference or not but more information is better than less I 
> suppose.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to