I need something that can generate a PDB from a DLL file (C# .NET code), is there any free program to do that?
You need the source code in order to generate a PDB.
Even you have no sources and code obfuscated, you can create pdb by recompile with ildasm and ilasm:
- decompile assembly by ildasm: ildasm /out=assembly_name.il assembly_name.dll
- complile with ilasm: ilasm assembly_name.il /dll /pdb
PDB contains debug symbols related to DLL, and would normally be built together with the DLL. To enable generating pdb files go to project Properties, Build tab, Advanced... button and select in Debug Info field "pdb-only" or "full":

If you need to debug a thirdparty assembly without sources, then dotPeek and ReSharper will be extremely helpful having an option to generate PDB from DLL. In ReSharper, this can be done through ReSharper > Windows > Assembly Explorer by opening necessary assembly and clicking "Generate Pdb...":
来源:https://stackoverflow.com/questions/2859226/generate-pdb-from-net-dll-file