最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can Rust Cargo generate a WebAssembly (WASM) file that retains local variable names? - Stack Overflow

programmeradmin1浏览0评论

I am using cargo build --target wasm32-unknown-unknown to compile a Rust file into a WASM module and then parsing the WASM file using wasmparser. However, when I parse the name custom section, I can only retrieve function names from the source code, but the local variable names are missing.

With the same approach, I tested WASM files compiled from other languages, and they correctly retained local variable names.

I suspect that cargo build discards local variable names during compilation. How can I prevent this and ensure that Cargo generates a WASM file that retains local variable names?

How can I prevent this and ensure that Cargo generates a WASM file that retains local variable names?

发布评论

评论列表(0)

  1. 暂无评论