My Visual Studio 2013 is unable to load MFC symbols.
After setting some options in Visual Studio, I am able to load symbols for most of the Windows DLLs, but MFC symbols (more exact: mfc120ud.i386.pdb and mfc120d.i386.pdb) are still missing.
What I have tried so far:
Enabled the Microsoft Symbol Servers.
Under "Automatically load symbols for:" selected "All modules, unless excluded"
Unchecked "Just My Code"
Searched locally for the files
Any ideas?
The default setting of Microsoft Symbol Servers only uses HTTP protocol, but loading MFC symbols seems to require HTTPS.
When https://msdl.microsoft.com/download/symbols is added to the symbol file locations, the missing MFC symbols were loaded successfully.
Related
I'm developing a C# MVC project in Visual Studio 2013 Express for Web. An external C++ DLL is imported into the project and a function which is exported from the DLL is consumed.
I would like to be able to debug into the C++ DLL. However at the moment when I try to step into the function call the debugger steps over instead. The C++ DLL is one I created myself in Visual Studio 2013 Express for Windows Desktop. I have generated the .pdb debug symbols for the DLL and they are in the same folder as the DLL.
I have read in similar posts that suggest perhaps there is a properties setting to enable debugging into external an DLL. However in the MVC 5 project properties I can't find this option. In fact there doesn't even appear to be a debugging tab.
Is debugging into an external C++ DLL possible in Visual Studio 2013 Express for Web? If it is how do I enable this feature? If it is not possible, is there another Visual Studio Express where this is possible?
Thanks for your help!
I don't have VS Express, but the following applies to VS Professional and should apply to Express as well. You need to set your Debugger Type to Native Only (best, but then you have to break in the native code to debug it) or Mixed (may or may not work, I don't use it, so not sure it's limitations), and make sure the DLL is freshly build and matches the source code you have available. I suspect the setting you refer to is called 'Just My Code' (in Options->Debugging), but I don't think it matters in this case.
I'm not sure about VS2013 but with VS2015 you need to set "Enable Native Code Debugging". Right click on your C# project. In the right pane, click Debug. Under Enable Debuggers click the check box on Enable Native Code Debugging.
We have a .NET application using a lot of legacy components written in VB6. We were able to debug the VB6 code using native code debugger and generated pdb files in Visual Studio 2010. After upgrading to the VS 2012 (including Update 2) we cannot do this.
The module window shows following message:
Binary was not built with debug information.
You can also find following message in the output window:
Module was built without symbols.
When I try to load symbols manually, I get following message:
A matching symbol file was not found in this folder.
Debugging the very same dll or exe from VS 2010 works fine.
Is there any option to enable it?
I found a solution that works on my machine (per Microsoft's comments on ScottG's paid support request - thanks, Scott). Apparently Visual Studio's default debugger after 2010 doesn't handle VB6 DLLs, but there's a checkbox to use the old debug engine, which does:
I didn't need to enable Native Edit and Continue.
I have finally found how to enable debugging VB6 components using Visual Studio 2012. In short, you have to enable the old pdb format first by setting Options | Debugging | Edit and Continue | Enable native Edit and Continue and then you can attach to the dllhost.exe as usually.
In VS 2015 Tools->Options->Debugging->General, select 'Use Native Compatibility Mode'. It sucks that I still need to debug VB6, but I am thankful that I am still able to.
it seems that VS 2012 use msdia110.dll to decode symbol files, there's a DIA SDK sample in VS folder, you can test whether it can parse those VB pdb files. if it can't, i guess the new version DIA does not support old version pdb any more.
I have disabled "Microsoft Symbol Servers" and added path to .NET 4.5 symbols (W:\Debug\RefSrc\Symbols) that I downloaded from http://referencesource.microsoft.com/.
Unfortunately when I force loading of symbols, for example on mscorlib.dll, Visual Studio ignores this folder and proceeds to download symbol file from symbol server. They end up in W:\Debug\SymbolsCache\MicrosoftPublicSymbols and are exactly identical to those in RefSrc.
Is anyone else seeing this behavior ?
My debug settings:
[ ] Enable Just my code
[ ] Enable .NET framework source stepping
[ ] Enable source server support
I had to disable ".NET framework source stepping" because of this.
don't know how you do it in VS 2012 because I never tried it and now I don't have VS 2012, but the way I do it in VS 2010 is the following:
Debug - from main menu
Options and settings
Debugging -> General
Check Enable .NET Framework Source Stepping and uncheck Enable Just My Code
Go to Debugging -> Symbols
Pick a location for "Cache symbols in this directory"
Check the Microsoft Symbol Servers
Ok
Start your application in Debug mode
Go to Debug menu item and choose Windows->Modules
Press F11 to step into Microsoft .NET Framework code (the one that is public, because from as far as I know not all is)
Hope this helps you a bit. I would disable Enable just my code. Also, if I remember correctly, is possible to select from where to load the symbols when you open the Modules window, by right clicking on the item you want to load the sources for.If the pdb file does not correspond to the binary file, it won't load the symbols if the versions are not the same.
I used to work with VS 2008 but I am missing the following feature in VS 2010 when debugging MFC C++ app:
whenever an assertion occurs, VS 2008 automatically opens the source file and focus the line with an assertion expression
in VS 2010 I have to mark the file name and line of assertion and then manually open the source file and scroll to the expression
Is there some option or registry setting how to enable such behaviour in VS2010 like it works in VS 2008 ?
The first setting that really matters in in the Project + Properties, General page, "Use of MFC". You'll have no trouble if you select the "Use MFC in a static library" setting. This causes the linker to generate the debugger .pdb file entries for MFC symbols, giving the debugger an easy time to find the MFC source code files on your machine.
This isn't always practical however, the "Use MFC in a shared library" setting is the normal one. Which will load the MFC dll from c:\windows\system32, put there when you installed VS. Getting a .pdb for this DLL requires enabling the Microsoft symbol server, Tools + Options, Debugging, Symbols. Press F1 to get config help for this setting page.
You can verify this worked out by using Debug + Windows + Modules while debugging and checking the Symbol File column for mfc100xx.dll. Right-clicking the module and Symbol Load Information provides additional info, showing which directories were searched to find the .pdb
A further complication is that the .pdb that the debugger will download was created on a build server in Redmond which had the source code files installed in f:\dd\vctools\vc7libs\ship\atlmfc. Obviously not the directory where you have them installed. The IDE will prompt you for the actual source code directory. This prompt is often highly confuzzling so clicking Cancel on the dialog is a common thing to do. You now however bought the farm, the IDE remembers that you cancelled this dialog and won't prompt you again. You reset that by deleting the hidden .suo file in the solution directory.
When debugging with Visual Studio 2010, sometimes there aren't PDB files available for system libraries as I've not built them myself (i.e. they've not been built for debugging). This is OK as I don't need to access them. A sample warning might be something like:
'Plugin Host.exe': Loaded 'C:\Windows\SysWOW64\xmllite.dll', Cannot find or open the PDB file
However these warnings clog up the Output pane making it quite hard to debug sometimes. Is there a way to suppress these at all?
Thanks, Hemmer
These PDBs actually are available, enable the Microsoft Symbol Server support. But yes, you can suppress these messages. Right-click the Output window while debugging and untick "Module Load Messages". The value is preserved for future debug sessions. Note that it isn't actually a warning, just a diagnostic that tells you which DLLs are getting loaded.