Edward, welcome.
The short answer is it depends. PDB is Microsoft's proprietary format and is not documented. While MS offers APIs to read and extract data from PDBs (see
DIA SDK - Debug Interface Access SDK), there is no official API or documentation on how to generate or change PDB files. With this on mind it is very unlikely that you will find a tool to convert COFF/STABS into PDBs. Further it is unlikely that GNU tools them self would be able to emit PDBs any time soon.
On the other side it should be much easier to make a WinDbg extension which reads the GNU debug information and feeds it to WinDbg's internal symbols tables. In fact the
SDbgExt extension does something similar; it reads MAP files generated by a MS linker and feeds that information to WinDbg. Obviously a MAP file doesn't contain as much debug information as a PDB file would, but it is still much better than looking at disassembly. Now, if only GNU MAP files would be the same as Microsoft's are. Unfortunately they are not...
To summarize it you seem to have the following options:
- Write a WinDbg extension which reads COFF/STABS and feeds this information to WinDbg.
- Convert GNU MAP files to the Microsoft MAP format and use the SDbgExt extension to read it into WinDbg.
- If you only have to do a limited amount of debugging with your DLL, you might turn to the handy OutputDebugString function. Through it your DLL could even send debugger commands to WinDbg from the code itself. See .ocommand (Expect Commands from Target) for more details.
You might also find the following links interesting:
Description of the .PDB files and of the .DBG files
How to identify where a failure is occurring in your code by using the address in the error message
I hope this helps,
Robert