rainers / cv2pdb

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

Invalid form=11 for directory index lineHdrOffs=7ded41 #76

Closed petitg1987 closed 2 years ago

petitg1987 commented 2 years ago

I have a binary built on MinGw/Msys with g++ v11.2.0 and I've got the following error when I try to use cv2pdb on it:

$ ./cv2pdb.exe photonEngineer.exe
interpretDWARFLines:386: ERROR: invalid form=11 for directory index lineHdrOffs=7ded41
C:\msys64\home\greg\photonEngineer.pdb: cannot add line number info to module

Here is the executable file: https://drive.google.com/file/d/1BsmJmojMkkdN95nZ4-JU5uX6KikgFbXv/view?usp=sharing

Any idea on the cause of the error ? I tried with a hello world binary and it works correctly (no error).

rainers commented 2 years ago

interpretDWARFLines:386: ERROR: invalid form=11 for directory index lineHdrOffs=7ded41

If parsing up to that point was correct, it means that there is an invalid entry in the debug line number infos. This is part of the DWARF5 debug info format, so maybe switching to an earlier version might help.

Here is the executable file: https://drive.google.com/file/d/1BsmJmojMkkdN95nZ4-JU5uX6KikgFbXv/view?usp=sharing

The file is behind a login and additional security checks, can you make it more easily downloadable?

petitg1987 commented 2 years ago

Thank you for your answer. I will try soon to build the application with DWARF4 and check if it works. Is cv2pdb supposed to work with DWARF5 ?

Here is a link to download the file without login request: https://cv2pdb.s3.eu-central-1.amazonaws.com/photonEngineer.exe

rainers commented 2 years ago

DWARF5 support was recently added by some contributors, so I'm not too familiar with it. According to the spec, some data formats were not supported, https://github.com/rainers/cv2pdb/commit/f390ed4c0aef0f0acd3f880c82564558bc2e0786 seems to fix that.

petitg1987 commented 2 years ago

Fix tested and everything is fine. Thank you very much !