Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio No Symbols have been loaded for this document

I am having some trouble debugging a visual studio 2008 C++ project. When I start running it in debug, the breakpoints are disabled with the message

The Breakpoint will not be hit. No Symbols have been loaded for this document.

I have tried cleaning and rebuilding, but this doesn't make a difference.

I also tried looking in Debug->Windows->Modules. If I right click on the module I am trying to debug and press Symbol load information it brings up a list of places it has tried to load the symbols from. The first in the list is correct and the file exists, but next to it is this error

C:\path\to\my\symbol\Debug\MyProject.pdb: Unknown symbol handler for error

Does anyone know what causes this or how to fix it?

like image 692
Jim Jeffries Avatar asked Dec 01 '11 12:12

Jim Jeffries


People also ask

How do I fix No symbols have been loaded for this document?

"No Symbols have been loaded for this document"Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded. If your module is loaded, check the Symbol Status column to see whether symbols have been loaded.

How do I see loaded symbols in Visual Studio?

In Visual Studio, open Tools > Options > Debugging > Symbols (or Debug > Options > Symbols).


2 Answers

First of all, it is possible that some of your modules won't show in the module window, because some of them may be loaded dynamically (only as needed).

You might want to check in your project properties under Linker > Debugging > Generate Program Database File and Generate Debug Info. Be sure these two are set properly.

Also, check if C/C++ > General > Debug Information Format is set to Program Database for Edit And Continue (/ZI) or something similar.

I know you mentioned that your symbol file exists, but checking what I just mentioned will ensure you have the right version of your symbol in the right place.

Finally, check if all your project and files in your solution are set to compile as Debug and not Release or something else, because no symbols will be generated (hence none will be loaded) for this project / file.

Hope this helps a bit.

like image 161
TurnsCoffeeIntoScripts Avatar answered Sep 21 '22 04:09

TurnsCoffeeIntoScripts


In my case, the problem was solved by checking "Use Managed Compatibility Mode" in Tools / Options / Debugging / General.

like image 27
Razvan Socol Avatar answered Sep 22 '22 04:09

Razvan Socol