rainers / cv2pdb

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

.dbg for a 64 bit executable #40

Closed tim-lebedkov closed 5 years ago

tim-lebedkov commented 5 years ago

I converted a .dbg file for a 64 bit executable to .pdb. The .pdb is 32 bit (DBI-Stream Machine = 332).

I guess this is why AMD uProf does not load the .pdb file. Does cv2pdb always create 32 bit .pdb from a .dbg file? Can a .dbg file be 64 bit? Could you please add an option to force the creation of a 64 bit .pdb?

tim-lebedkov commented 5 years ago

BTW, thank you very much for this software!

tim-lebedkov commented 5 years ago

The .dbg file is 64 bit. The values at offsets 4 and 5 are 0x64 and 0x86 respectively,

rainers commented 5 years ago

I don't know much abiout DBG files, support for these has been added by @AlexWhiter. Maybe he can comment on 64-bit versions? Maybe only this line needs to be adapted: https://github.com/rainers/cv2pdb/blob/master/src/cv2pdb.cpp#L71

tim-lebedkov commented 5 years ago

It seems hdr64 is never set in https://github.com/rainers/cv2pdb/blob/master/src/PEImage.cpp#L309 so that isX64() returns false. Would any of you have time to look into this?

AlexWhiter commented 5 years ago

@tim-lebedkov Could you please try to change DbiStreamHeader.Machine value in your PDB manually to check if uProf would load it?

rainers commented 5 years ago

The machine type should now be set in the PDB as found in the DBG.