I did a little research, and it seems map2dbg can be used for 64-bit executables made in Delphi XE2. The only thing you have to change is the WORD in the generated DBG file with offset 4 from $ 8664 to $ 014C.
Yes, it looks like nonsense, because it means changing the “Machine” field in the DBG header from AMD64 to X86, but it really causes the DBG file to load correctly in both WinDbg and Process Explorer.
I made a fixed version of map2dbg version 1.3, so it automatically writes $ 14c to DBG. Here is the archive: http://yadi.sk/d/kbVFCGyI2gQzM
UPDATE: DBG files created with a fixed version of map2dbg are accepted by both Process Explorer and WinDbg, and the characters from these DBGs are correctly associated with the corresponding addresses in the executable file, but incorrect stack frames are displayed.
Reason in the DBGHELP library. As you can see from its disassembly, it only downloads DBG files made for X86 or Alpha processors (the value of the machine field is $ 14c and $ 184). But if we manually change the "Machine" field in the DBG file from AMD64 to X86, then DBGHELP will process the executable file as a 32-bit module (therefore, the PDATA segment from the executable file will not be used during stack unloading), and the incorrect stack will be displayed by debuggers .
I fixed the x86 and x64 versions of DBGHELP installed with WinSDK for Win8. Patch versions allow you to load DBG files with an AMD64 Machine field ($ 8664), so stack frames are displayed as expected. These versions are available in this archive: http://yadi.sk/d/7ZDLv2ed2gRGo
So now we have two different approaches to using characters from 64-bit executables compiled with Delphi XE2:
A simple way: use the fixed 2dbg map to create fake-x86 DBG files that can be loaded into WinDbg and Process Explorer, so symbol addresses will be shown, but debuggers will not be able to display stack frames.
"Hardcore": use the fixed dbghelp.dll with support for AMD64 DBG files. With this version of DBGHELP, WinDbg and Process Explorer can unwind stack frames.
ONE MORE UPDATE: The cv2pdb tool can now convert DBG files created using map2dbg to PDB. Both 32-bit and 64-bit executables are supported.
Below is a compiled version of the latest cv2pdb sources.
source share