OK let me explain in a bit more detail what I'm doing...
We have huge source code trees that contain multiple products. Most products have dependencies all over its source code tree (some even in other source code trees). All the projects are either build using MAKE or SCons. These are build for both Windows and Linux.
In the past, debugging these projects in VS was a bit of a pain since while you can debug in VS, VS didn't know much about the source files and could not locate symbol definitions etc. It didn't know where header files are located, etc etc.
I started an internal framework project that helps to integrate this into VS. Right now I'm parsing through MAKE logs to figure out what files were included in the build, and which preprocessor definitions, include folders etc were used. This info is then used to auto-configure the VS project's source files, preprocessor definitions etc. Doing this, the debugging experience becomes much better because now VS can actually find symbols, open header files by itself, etc etc. Now it knows the "Big Picture". This framework has a bunch of other features too but that is probably one of the main ones (the other is to enable remote Linux debugging inside VS).
Anyway, I'm now looking for a faster, more reliable and less hacky way to extract source file, header file, include folders and preprocessor definition info from the DLLs and PDB files.
So far I've had good luck playing around with DbgHelp.dll. I can now enumerate all source files given a DLL/EXE and its matching PDB file (which I will always have). Using a binary editor, I can clearly see that the PDB file contains the original argument used to initiate the build, which does contain all of the preprocessor definitions etc. However I'm now combing through the DbgHelp.dll help file to see which of the functions can give me that info.
BTW I plan to do the same thing for unstripped Linux *.so files, and somehow I'm sure there will be tools on Linux to extract that info as well.