You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was going to try to read dwarf debugging info from a wasm binary but I get the error Error("Unknown file magic") is loading webassembly binaries and their associated dwarf debug info sections supported by the Loader in addr2line? I know gimli can load wasm binaries and their associated debugging info using the object crate but it seems the loader might work differently here in addr2line.
I'm currently just doing something like this. Any help appreciated!
let loader = Loader::new(wasm_binary).expect(&format!("Failed to get dwarf info for \"{}\"", wasm_binary));
loader.find_location(150);
The text was updated successfully, but these errors were encountered:
Looking at it a bit more it seems I just need to enable to wasm feature on the object crate used by addr2line. I'm not really an expert at rust, what is the best way to specify this? Currently I just have this and this seems to work but this doesn't seem ideal.
object = { version = "0.36.0", features = ["wasm"] }
addr2line = "0.24.2"
We could add a wasm feature to addr2line that in turn enables wasm for object. However, before doing that I would like confirmation that using addr2line for Wasm is actually useful for you. The reason I ask is because I think that the normal use case for DWARF in Wasm files is that when compiling the Wasm to native instructions, the DWARF will get transformed to match the native addresses, and addr2line is used on that transformed DWARF instead.
The VM which I use for development does not compile wasm down to native instructions, it is a traditional bytecode interpreter. Consequently, the program counter is a location in the original wasm binary and I use the dwarf in the binary itself to map that program counter into a line number.
I was going to try to read dwarf debugging info from a wasm binary but I get the error
Error("Unknown file magic")
is loading webassembly binaries and their associated dwarf debug info sections supported by the Loader in addr2line? I know gimli can load wasm binaries and their associated debugging info using the object crate but it seems the loader might work differently here in addr2line.I'm currently just doing something like this. Any help appreciated!
The text was updated successfully, but these errors were encountered: