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.
Thank you very much! It's very comprehensive!