rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
466 stars 110 forks source link

Vastly Improved DWARF to PDB Support #86

Closed alexbudfb closed 1 year ago

alexbudfb commented 1 year ago

This PR contributes a number of significant improvements to DWARF to PDB conversion. The key one being construction of a "DWARF tree" to allow for fully-qualified name generation for procs, structs, enums and classes. The individual commits have detailed descriptions of what each one does.

This was tested on a sizable cross-compiled binary (via clang + mingw) from AOSP (aidl.exe in particular) and is what motivated these improvements. Prior to this PR, one was not able to get usable symbols after conversion. For example, classes were not able to be inspected and showed up as empty, among other things.

NOTE: Only DWARF v4 was tested. DWARF v5 seems like a work in progress anyway and incomplete based on my attempts at converting the DWARF v5-compiled aidl.exe.

rainers commented 1 year ago

I have pushed a couple of commits to address my nits and fix the github actions test build.

alexbudfb commented 1 year ago

Thanks a lot for your contribution. This is great stuff!

Thank you!

Would it maake sense to put some of your commit messages into the source code for explanation?

Yes, I think I can do that. Though I assume we won't be squash-merging the changes and the commits will be preserved?

Would it be feasible to add some basic tests? See https://github.com/rainers/cv2pdb/blob/master/.github/workflows/build-and-test.yml for examples.

How can I run these tests locally?

I have pushed a couple of commits to address my nits and fix the github actions test build.

Thank you for adding the extra fixes!

FYI: I will be on vacation for the next week so the earliest I will be able to get to this is sometime later in the month.

rainers commented 1 year ago

Sorry for the delay. I'll merge as is so it doesn't get lost. Thanks again for your contribution.