rainers / cv2pdb

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

Abort Failed on 64 bit Windows using MinGW64 #3

Closed orangeduck closed 9 years ago

orangeduck commented 9 years ago

Hi,

I'm using MinGW64 and I was wishing to generate pdb files for the executables I've compiled so that I could print out debug information such as stack traces using the windows API. I compiled this current master branch using Windows 7 Visual Studio 2013 in debug x64 mode. Compilation runs fine with a few warnings.

But when I try to run cv2pdb on my executables I get the following error:

D:\Projects\mpc>cv2pdb test.exe
Assertion failed: abbrev, file d:\sources\cv2pdb-master\src\readdwarf.cpp, line
394

D:\Projects\mpc>

I've tried the same process on various other executables and I get the same result. Here is a sample executable you can try it on compiled from my ptest library.

Do you have any insight into this error? I'm happy to try and investigate and potentially contribute a fix but I'm really not sure where to start. I suspected it may be something to do with using MinGW64 rather than standard 32-bit MinGW but I'm not sure.

Thanks,

Dan

rainers commented 9 years ago

The code has recently been revamped by someone else (see commits), so I had to find my way through this, too. I've pushed a fix to master, please try that.

The problem of this assert was a misinterpretation of the DW_FORM_strp entry. Continuing from there showed other asserts for which I added some workarounds. Note that the debug info also contained a type __int128, which seems recognized by VC, but not allowed on x86/64. I'v made up some CV type code, not sure what the debugger will do wth this.

orangeduck commented 9 years ago

I can verify that the updates to master have fixed this. Many thanks!