Slow loading of symbols during call to CoCreateIns

2019-08-08 19:55发布

In my MFC project I call CoCreateInstance at some point:

if ( SUCCEEDED( CoCreateInstance ( CLSID_DragDropHelper, NULL,
                                   CLSCTX_INPROC_SERVER,
                                   IID_IDropTargetHelper,
                                  (void**) &m_piDropHelper ) ))
{
   ...
}

and a bit later once I'm done with the DragDropHelper I call Release:

m_piDropHelper->Release();

So far so good, everything works fine.

But during debug the very first call to this CoCreateInstance is painfully slow because VS is loading tons of symbols (this loading is visible in the VS Output window, see below). Subsequent calls to the same CoCreateInstance are fast. But when I restart de debugee, the first call to this CoCreateInstance is slow again.

I don't need these symbols for my purpose.

Is there a way to prevent Visual Studio from loading all these symbols.

Partial content of Output Window during debug

'MyProg.exe': Loaded 'C:\Windows\SysWOW64\WindowsCodecs.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Program Files (x86)\Common Files\TortoiseOverlays\TortoiseOverlays.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGitStub32.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\TortoiseGit32.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\libgit232_tgit.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files\TortoiseGit\bin\zlib132_tgit.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\msvcr120.dll', Symbols loaded.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Symbols loaded (source information stripped).
   <30 more similar lines>
'MyProg.exe': Unloaded 'C:\Program Files (x86)\Microsoft Office\Office14\GROOVEEX.DLL'
'MyProg.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\Office14\GROOVEEX.DLL', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.6161_none_51cd0a7abbe4e19b\ATL90.dll', Symbols loaded (source information stripped).
'MyProg.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\Cultures\OFFICE.ODF', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Program Files (x86)\Microsoft Office\Office14\1036\GrooveIntlResource.dll', Cannot find or open the PDB file.
'MyProg.exe': Loaded 'C:\Windows\SysWOW64\RpcRtRemote.dll', Symbols loaded (source information stripped).

1条回答
老娘就宠你
2楼-- · 2019-08-08 20:24

You can include/exclude symbols by using Tools/Options/Debugging/Symbols.

enter image description here

The two options for "Automatically load symbols for:" should provide what you want.

查看更多
登录 后发表回答