Replies: 2 comments 1 reply
-
When you say " there is quite a bit of emscripten glue that needs to be stepped over/into to finally get to the function itself." I asume you mean JS wrapper code? I'm pretty sure you should be able to set a breakpoint on a wasm function by name, without having the step through the JS wrapper code. I don't you should need to know a wasm functions address or anything like that just to set a breakpoint on it. @pfaffe I assume this should be possible somehow in the UI? |
Beta Was this translation helpful? Give feedback.
-
DevTools can't set breakpoints on functions by name, I'm afraid, but if you have the address you can jump to it in the sources panel in the wasm file (Ctrl+g). You can also make stepping nicer by adding the JS glue to the ignore list: https://developer.chrome.com/docs/devtools/settings/ignore-list |
Beta Was this translation helpful? Give feedback.
-
We have a program that has several places that save off function pointers.
If we are using the dwarf debugger in chrome, if you step into those functions, there is quite a bit of emscripten glue that needs to be stepped over/into to finally get to the function itself.
We have come up with creative ways to work around the problem of identifying the function referenced, one of which was to dump out the values of the pointers when saved off to later refer to when used.
I was hoping that I could have the code introspect and get the function name, because ultimately when the function is hit, the dwarf debugger can produce a stack, and I assume that it is doing this off some internal tables that might have information on function addresses and names.
I had hoped that I could just add the code by leveraging dladdr, but it appears that has never worked or been implemented.
According to this fix, dladdr is just a stub and will always return an error.
Is there a way to either:
If manually, is the information already there if compiled with debug (-g) and I would just need to use an llvm tool to dump the information?
I see that llvm-nm can be used to dump symbols from an archive (*.a) but since the addresses are not available until link time, this is likely not going to help.
I am reading and rereading this around functions which may have the answer I need...
Thank you in advance for your help or pointer.
P.S. Being able to leverage the debugger with Emscripten was a game changer. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions