Any doc about the debuginfo generated by rustc with the "-g" option?

Hi! I'm working on a project that needs to parse the debuginfo generated by rustc with the "-g" option. I'm trying to find some docs about it but haven't found anything yet. The rustc book mentions little, just "This flag controls the generation of debug information..." in the "Code gen options" section. If anyone can guide me to a detailed doc? Thanks a lot!

It produces target-specific debugging information. For windows-msvc that's PDB, and I think everything else uses DWARF.

Since these are the same formats used by C and C++ code on each platform, you can generally use the same tools and libraries you would for C++ debuginfo, like gimli for DWARF platforms. Rust name mangling is based on C++ name mangling, with some minor differences. You can use the rustc-demangle crate decode it.

You might be interested in Symbolic or its component libraries. Also check out object and goblin.

OK, thanks!

Thank you very much! It's very comprehensive!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.