Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugger does not step into MFC source code

I have a new SDI project in VS2010 but I can't step into MFC source. I followed the steps here and it seems like the resource symbols are not loaded for some reasons but it wouldn't load on right click either as described in the most voted answer there.

When I go into debug >> Windows > Modules, that window shows the symbol status column as Cannot find or open the PDB file. I guess that's the problem but when I right click on any one module (for example mfc100enu.dll) I get another dialog with similar message than can't find symbol file.

What could have gone wrong that it can't find symbol files and how to fix this?

Module Window

The function I want to step into is LoadFrame in below in my basic SDI application.

BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext) 
{
    // base class does the real work

    if (!CFrameWndEx::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext))
    {
        return FALSE;
    }

...
}

Any hints how can I not load them and what might be wrong? Thanks

Update

I was able to get VS2010 to load the symbol files by going to Tools->Options->Debugging->Symbols and select checkbox "Microsoft Symbol Servers" and now Visual Studio loads PDBs automatically. However I still can't step into the function.

like image 339
zar Avatar asked Apr 22 '14 14:04

zar


1 Answers

I found that adding the symbol servers didn't solve the problem for me.

What did solve the problem was adding this directory to the list of locations to look for symbols. Not sure why Visual Studio doesn't add this itself.

C:\Windows\Symbols\dll

like image 93
Stephen Kellett Avatar answered Sep 21 '22 01:09

Stephen Kellett