Debugger problem "The breakpoint will not currently be hit. No symbols have been loaded for this document


網上收集到的相關解決辦法:

1st
Start debugging. Now select Debug->Windows->Modules. In the modules window taht now appears, check what the Symbol Status reads. If it reads "Symbols not loaded", then right click on that row, Load Symbols and select the corresponding pdb file.
If the Symbol Status reads "binary was not built with debug info", you have not built your project with debug information.

To do this:
1) Goto Project->Properties
2) Make sure "Configuration" at the top is "Debug"
3) On the left, select "C/C++", then "General"
4) On the right, change "Debug information format" to "Program Database for edit and continue (/ZI)"
5) On the left, Select "Optimization"
6) On the right, Change "Optimization" to "Disabled (/Od)"
7) On the left, select "Code Generation"
8) On the right, change "Runtime library" to "Multi-Threaded Debug (/MTd)"
9) On the left, expand "Linker" and select "Debugging"
10) On the right, change "Generate Debug info" to "Yes (/DEBUG)"
11) Rebuild your project.

Spent a day working this out.. googling always helps !!! A big thanks to these forums.

2nd

Steps taken / other info:

1).  tried rebuilding the application many times

2).  tried completely deleting and redoing it from scratch

3).  the .pdb file is in the same location as the DLL with the same name and time

4).  my project is running on the debug version of the DLL and associated files

5).  ensured there was only one instance of the DLL, project, etc. on the machine

6).  right clicked on a DLL that is within the Modules window, selected Symbol Settings, selected Debugging | Symbols and manually added the directory with the .pdb file - even though I confirmed that this is the default location used by the project

7).  checked that Enable Just My Code is not selected within the Symbol Settings | Debugging | General menu

8).  tried placing the DLL in the C:\Windows32\ directory just to see if the Modules Window would "see" it

9).  tried adjusting a few other things to match suggestions regarding optimization settings, etc.

10).  tried selecting Load DLL exports within within the Symbol Settings | Debugging | Native menu (although I am not familiar with what this may actually be doing); this caused most of the DLL's in the Modules window to have a listing of Exports Loaded, but did not appear to affect my issue in any way - again my DLL is not within the Modules window

 

另外, 試試tools--> attatch to process.

如果還不行,那可能就是調用這個DLL的主程序的問題了

 

如果attatcha進行調試時候,發現不是實心點,說明你沒有掛上,不能debug,此時解決方法如下。

1.刪除站點bin目錄下所有pdb文件,

2.選擇vs的 Tools->options->Debugging->Symbols,將你的編譯目錄添加進去。

3.選擇vs的Tools. Options,Debug, General,And uncheck: "Enable Just My Code."

4.如果這些dll處於版本控制之下,建議取消控制。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM