Search code examples
.netdebuggingpdb-files

What does the PDB get me while debugging and how do I know it's working?


I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects.

CorpObject o = new CorpObject();
Int32 result = o.DoSomethingLousy();

While debugging, the method 'DoSomethingLousy' throws an exception. What does the PDB file do for me? If it does something nice, how can I be sure I'm making use of it?


Solution

  • To confirm if you're using the provided PDB, CorporateComponent.pdb, during debugging within the Visual Studio IDE review the output window and locate the line indicating that the CorporateComponent.dll is loaded and followed by the string Symbols loaded.

    To illustrate from a project of mine:

    The thread 0x6a0 has exited with code 0 (0x0).
    The thread 0x1f78 has exited with code 0 (0x0).
    'AvayaConfigurationService.vshost.exe' (Managed): Loaded 'C:\Development\Src\trunk\ntity\AvayaConfigurationService\AvayaConfigurationService\bin\Debug  \AvayaConfigurationService.exe', Symbols loaded.
    'AvayaConfigurationService.vshost.exe' (Managed): Loaded 'C:\Development\Src\trunk\ntity\AvayaConfigurationService\AvayaConfigurationService\bin\Debug\IPOConfigService.dll', No symbols loaded.
    

    Loaded 'C:\Development\src...\bin\Debug\AvayaConfigurationService.exe', Symbols loaded.

    This indicates that the PDB was found and loaded by the IDE debugger.

    As indicated by others When examining stack frames within your application you should be able to see the symbols from the CorporateComponent.pdb. If you don't then perhaps the third-party did not include symbol information in the release PDB build.