8000 Missing `.debug_info` Section in DWARF Information · Issue #4938 · dfinity/motoko · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Missing .debug_info Section in DWARF Information #4938

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

Open
hapeeeeee opened this issue Mar 10, 2025 · 4 comments
Open

Missing .debug_info Section in DWARF Information #4938

hapeeeeee opened this issue Mar 10, 2025 · 4 comments

Comments

@hapeeeeee
Copy link

I attempted to use the gimli library to parse a WebAssembly (Wasm) file that includes debug information. The Wasm file was written in Motoko and compiled using moc. However, my program reported that the .debug_info section was missing.

To investigate further, I used wasm-objdump to inspect the sections within the Wasm file. As expected, the .debug_info section was indeed absent.

Image

@crusso
Copy link
Contributor
crusso commented Mar 12, 2025

Did you use the moc -g flag? We do produce some dwarf debug info, but gave up pursuing this further. @ggreif would know more about the status and which version of Dwarf we were emitting.

@hapeeeeee
Copy link
Author

Did you use the flag? We do produce some dwarf debug info, but gave up pursuing this further. @ggreif would know more about the status and which version of Dwarf we were emitting.moc -g

Sure. I used the -g option with moc, and as shown in the screenshot, the DWARF information already includes custom sections like debug_line and debug_line_str. These were generated through the -g option. However, the most essential section, debug_info, is still missing.

@ggreif
Copy link
Contributor
ggreif commented Mar 12, 2025

RIght, we never finalised the DWARF5 generation as we had more important stuff to do. There is no way to attach a debugger to the IC or a local replica for that matter. The only way to attach a debugger was via WASI compilation and bare wasmtime. So the best one could use it for was to debug modules running in that context. The value in that didn't justify the effort necessary at that time.

The PR for the third part of DWARF is still around, but seriously bitrotten and was woefully incomplete. It was a tech demo at most.

@hapeeeeee
Copy link
Author

Alright, in fact, I have already parsed the debug_line and debug_line_str sections in a secondary way to obtain line number information for the Motoko debugger. However, just like in #4939, the parsed line number information is incorrect, which is critical — incorrect line numbers make it completely impossible to support the development of the Motoko debugger.

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

3 participants
0