rainers / cv2pdb

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

Visual Studio still says "Source Not Available" #50

Closed Daniel15 closed 5 years ago

Daniel15 commented 5 years ago

Hi! I'm trying to use your app to get debugging symbols for the GPGME C library, so I can debug some issues with my usage of it from C#.

I've compiled my own version of libgpgme-11.dll with debug symbols intact, and have used cv2pdb to generate a PDB. Visual Studio says:

Loaded 'C:\Program Files (x86)\GnuPG\bin\libgpgme-11.dll'. Symbols loaded.

Which makes me think that it has found the PDB file.

However, It still says:

Source Not Available Source information is missing from the debug information for this module

when I try to debug the library: image

Do you know what could be causing it?

I've attached the original DLL, DLL output by cv2pdb, and the PDB file here: libgpgme-11.zip

rainers commented 5 years ago

There is only debug information for the mingw runtime in the original DLL. You can check by dumping the output of objdump.exe -W libgpgme-11-original.dll and searching for DW_TAG_compile_unit.

I guess something went wrong when building a debug version of that DLL.

Daniel15 commented 5 years ago

Thanks for your reply, @rainers! I'm following up on the GPG mailing list to determine what's up: https://lists.gnupg.org/pipermail/gnupg-devel/2019-February/034189.html

I guess this is not a cv2pdb issue so I'm going to close this, but I'll reopen it if I still have issues once I figure out how to get the proper symbols in the DLL.

Daniel15 commented 5 years ago

I worked this out. The build process for libgpgme didn't properly pass through the CFLAGS and CXXFLAGS I specified. I manually modified the Makefile and added -gdwarf -O0, now the debug symbols are working:

Thank you for the useful tool!