Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM implementation? #7

Closed
justinclift opened this issue May 30, 2019 · 5 comments
Closed

LLVM implementation? #7

justinclift opened this issue May 30, 2019 · 5 comments

Comments

@justinclift
Copy link

With the DWARF sections currently generated by LLVM (v8, and development) for wasm, are they following this spec?

Asking because I'm writing some initial parsing code for the .debug_* sections in wasm files.

Will soon be up to figuring out how locations are handled (eg locals, heap, etc), and this spec seems to be the desired approach.

Just not sure if it's been implemented (even experimentally) yet. 😉

@yurydelendik
Copy link
Owner

With the DWARF sections currently generated by LLVM (v8, and development) for wasm, are they following this spec?

The location expression patch is not landed or reviewed yet -- that only affects wasm specific locations, such as wasm locals/params. The rest of the DWARF sections data, including simple constant expressions, are emitted per this spec in the LLVM.

The llvm-dwarfdump can inspect the wasm file sections. There is also https://github.com/yurydelendik/dwarf-to-json project (which is used at https://wasdk.github.io/wasmcodeexplorer/ and Firefox).

I'm not sure about the timeline of D52634 or another WIP patch landings. These patches are already present in Rust nightly. See also https://github.com/yurydelendik/llvm-project/tree/frame-pointer .

Closing the issue as answered. If you have further questions on the subject please continue the thread or contact me on IRC.

@justinclift
Copy link
Author

justinclift commented May 31, 2019

Fantastic, thanks heaps @yurydelendik I'll grab the patches from your frame-pointer branch, and apply them to the release_80 branch I'm working with. It's just a snapshot from yesterday, but has some other pieces in it I'm wanting. 😄

Btw, that "WebAssembly Code Explorer" should be really useful for people wanting to understand the bitcode format. 😄

Wish I'd realised it exists a few weeks ago, when first looking into that part of things. 😉

@justinclift
Copy link
Author

justinclift commented May 31, 2019

Hmmm, is this correct:

https://github.com/yurydelendik/llvm-project/blob/31859102016e952426b935536611bda7ded9c768/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp#L388-L393

Just asking because I'm not used to seeing braces {} without a control structure associated with them (for, if, etc)

@yurydelendik
Copy link
Owner

is this correct

I just put emphasis on WIP block of code I was planning to refactor or improve. The code is correct.

@justinclift
Copy link
Author

No worries. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants