yowl opened issue #7911:
Hi,
I'm trying to prepare a PR to add split wasm support, and I think I'd like to set
wasm_fileonDebugInfoDatato the name of the wasm file being processed. Would that be an appropriate use ofwasm_file?Probably set it here:
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasmtime/src/compile.rs#L69So I can use it somewhere around here
https://github.com/bytecodealliance/wasmtime/blob/2c6f38622d3b009293437839e5d75b4df64fa774/crates/cranelift/src/debug/transform/mod.rs#L88
if we encountergimli::UnitType::Skeleton, The wasm module will contain the name of thedwo, however if thedwofiles were packaged into adwpthen that name is arbirtrary and as far as I can see we can load it by convention, i,e, wasm file with the extension changed to.dwpor perhaps it can be an option passed to wasmtime, but in a later PR. Chrome loads.dwpby convention it seems, and emscripten follows that conventions. (I'm getting this info from https://developer.chrome.com/blog/faster-wasm-debugging/)Thanks,
alexcrichton commented on issue #7911:
Seems reasonable to me yeah, I had no idea this field even existed myself! I do think we'll want to be a little careful about the filesystem access though since using
Module::newfor example probably shouldn't go off reading the filesystem. When usingModule::from_file, however, reading the filesystem seems reasonable, but we probably don't want to read the dependent object files for each function and we'll want to make sure it only happens at most once.
yowl commented on issue #7911:
I wonder if I can ask for some more advice. I would like to pass the dwarf in here
https://github.com/bytecodealliance/wasmtime/blob/85ffc394a77d06bea15f460c78251651d154aaae/crates/wasmtime/src/compile.rs#L661
At least that's my current thinking. If I load the dwarf inModule::from_filethen I can store it inModuleorModuleInnerI guess, but how would I access that inlink_and_append_code, pass it all the way around?
alexcrichton commented on issue #7911:
It'll likely want to get attached somewhere within
ModuleTranslationalong the way. For aModule::from_filethat's probably threading an option down intoModule::from_binarywhich indicates that reading from the filesystem is ok or similar
yowl closed issue #7911:
Hi,
I'm trying to prepare a PR to add split wasm support, and I think I'd like to set
wasm_fileonDebugInfoDatato the name of the wasm file being processed. Would that be an appropriate use ofwasm_file?Probably set it here:
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasmtime/src/compile.rs#L69So I can use it somewhere around here
https://github.com/bytecodealliance/wasmtime/blob/2c6f38622d3b009293437839e5d75b4df64fa774/crates/cranelift/src/debug/transform/mod.rs#L88
if we encountergimli::UnitType::Skeleton, The wasm module will contain the name of thedwo, however if thedwofiles were packaged into adwpthen that name is arbirtrary and as far as I can see we can load it by convention, i,e, wasm file with the extension changed to.dwpor perhaps it can be an option passed to wasmtime, but in a later PR. Chrome loads.dwpby convention it seems, and emscripten follows that conventions. (I'm getting this info from https://developer.chrome.com/blog/faster-wasm-debugging/)Thanks,
yowl commented on issue #7911:
Thanks very much for the help, I have something working I think

yowl commented on issue #7911:
Going to close this now as #8055 exists. Thanks!
Last updated: Dec 06 2025 at 06:05 UTC