问题
I have an issue where I'm trying to selectively distribute my pdb(symbol) file so I can have users give me more detailed crash reports.
So... my DLL is injected into another exe (in another folder). And from everything I've tested, my PDB file has to be located in the exact same directory on the users machine that it is on my machine for it to be found correctly.
IE... When I build I place the PDB in C:\PDB\Mypdb.pdb
If the user creates the exact folder and places the pdb there, the injected dll will show him line numbers on crash. However, if he places the mypdb.pdb with the dll, or with the target of the injection, they receive nothing in terms of symbols.
Any ideas on how I can force my DLL to use a symbols file at a custimizable location?
回答1:
This is because by default the linker uses an absolute path to the location where it generates PDB file and stores it in the DLL itself. You can change the path to the PDB file by passing the /PDBALTPATH option and a relative path to the linker.
来源:https://stackoverflow.com/questions/31363404/injected-dll-cant-use-symbols-pdb-unless-its-in-the-same-directory-as-build